Rename create game element funcs to "spawn"

This commit is contained in:
Vortrex
2023-02-15 03:19:00 -06:00
parent ae0178717c
commit 8ca2e84e62
8 changed files with 156 additions and 109 deletions

View File

@@ -246,7 +246,13 @@ function checkServerGameTime() {
saveServerDataToDatabase();
logToConsole(LOG_INFO | LOG_WARN, `[V.RP.Timers] Changing server map to night`);
messageDiscordEventChannel("🌙 Changing server map to night");
despawnAllVehicles();
despawnAllNPCs();
despawnAllGroundItemObjects();
game.changeMap(getGameConfig().mainWorldScene[getGame()]);
spawnAllVehicles();
spawnAllNPCs();
spawnAllGroundItemObjects();
}
} else if (getGameConfig().mainWorldScene[getGame()] == "FREERIDENOC") {
if (isServerGoingToChangeMapsSoon(getServerConfig().hour, getServerConfig().minute)) {
@@ -260,7 +266,13 @@ function checkServerGameTime() {
saveServerDataToDatabase();
logToConsole(LOG_INFO | LOG_WARN, `[V.RP.Timers] Changing server map to day`);
messageDiscordEventChannel("🌞 Changing server map to day");
despawnAllVehicles();
despawnAllNPCs();
despawnAllGroundItemObjects();
game.changeMap(getGameConfig().mainWorldScene[getGame()]);
spawnAllVehicles();
spawnAllNPCs();
spawnAllGroundItemObjects();
}
}
}