Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: restart.
1. Startowe auta i ich restart.
Witam mam startowe auta na spawnie i chcia?bym doda? komend? "respawn" kt?ra respawnowa?a by auta kt?e s? nieu?ywane mam taki skrypt na /setspawn ale chcia?bym ?eby nie respawnowa? wszystkich lecz tylko te kt?re by?y by zawarte w skrypcie.

main_s:

[lua]


function respawn()
local accountname = getAccountName (getPlayerAccount(source))
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Respawn" ) ) then
outputChatBox("*** W ci?gu 15 sekund nast?pi respawn pojazd?w zachowaj ostro?no?? ***")
setTimer(function ()
local vehicles = getElementsByType ( "vehicle" )
for k, vehicle in ipairs ( vehicles ) do
if checkEmpty( vehicle ) then
local seats = getVehicleMaxPassengers(vehicle)
resetVehicleIdleTime ( vehicle )
respawnVehicle ( vehicle )
end
end
end, 15000, 1)
end
end
addEvent( "respawn", true )
addEventHandler( "respawn", getRootElement(), respawn )

function checkEmpty( vehicle )
local passengers = getVehicleMaxPassengers( vehicle )
if type( passengers ) == 'number' then
for seat = 0, passengers do
if getVehicleOccupant( vehicle, seat ) then
return false
end
end
end
return true
end


function respawn1(thePlayer, command)
local x, y, z = getElementPosition(thePlayer)
local vehicle = getPedOccupiedVehicle(thePlayer)
if vehicle then
local spawnVeh = setVehicleRespawnPosition (vehicle, x, y, z)
if spawnVeh then
ou...