Tematy otagowane jako: drobna
1. Skrypt respawn, drobna modyfikacja.
Witam, mam pro?b? czy m?g?by mi kto? przekszta?ci? ten ma?y skrypcik tak, ?eby pojazdy automatycznie respawnowa?y si? co 30 sekund zamiast u?ycia komendy? Oraz, ?eby nie by?o ?adnych powiadomie?, ?e ta czynno?? b?dzie/lub jest wykonywana (takie odchudzenie ). Z g?ry dzi?ki, pozdrawiam
local respawn = 30
local r
addCommandHandler ( "rav" ,function( player )
if isTimer ( r ) then
resetTimer ( r )
outputDebugString ( "Timer Reset" )
return
end
outputChatBox ( "RESPAWNING ALL UNOCCUPIED VEHICLES IN " .. respawn .. "SECONDS" )
outputDebugString ( "Cars Respawning" )
r = setTimer (function()
for _ , vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- For every vehicle do the following ...
if isEmpty ( vehicle ) then
resetVehicleIdleTime ( vehicle ) -- Reset the vehicle 's idle time
respawnVehicle ( vehicle )
end
end
outputDebugString("Cars Respawned")
outputChatBox("ALL UNOCCUPIED VEHICLES RESPAWNED")
end,respawn*1000,1)
end)
function isEmpty( 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