Inactive veh respawn timers
This commit is contained in:
@@ -107,6 +107,7 @@ function oneMinuteTimerFunction() {
|
||||
function tenMinuteTimerFunction() {
|
||||
showRandomTipToAllPlayers();
|
||||
saveAllServerDataToDatabase();
|
||||
checkInactiveVehicleRespawns();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -231,4 +232,15 @@ function showRandomTipToAllPlayers() {
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function checkInactiveVehicleRespawns() {
|
||||
let vehicles = getElementsByType(ELEMENT_VEHICLE);
|
||||
for(let i in vehicles) {
|
||||
if(getCurrentUnixTimestamp() - getVehicleData(vehicles[i]).respawnTime >= getGlobalConfig().vehicleInactiveRespawnDelay) {
|
||||
respawnVehicle(vehicles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user