Inactive veh respawn timers
This commit is contained in:
@@ -107,6 +107,7 @@ function oneMinuteTimerFunction() {
|
|||||||
function tenMinuteTimerFunction() {
|
function tenMinuteTimerFunction() {
|
||||||
showRandomTipToAllPlayers();
|
showRandomTipToAllPlayers();
|
||||||
saveAllServerDataToDatabase();
|
saveAllServerDataToDatabase();
|
||||||
|
checkInactiveVehicleRespawns();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -232,3 +233,14 @@ 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