diff --git a/scripts/server/misc.js b/scripts/server/misc.js index 32cdd64a..f1e5db6f 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -306,4 +306,24 @@ function playerChangeAFKState(client, afkState) { } } +// --------------------------------------------------------------------------- + +function checkPlayerSpawning() { + let clients = getClients(); + for(let i in clients) { + if(!isConsole(clients[i])) { + if(getPlayerData(clients[i])) { + if(getPlayerData(clients[i]).loggedIn) { + if(getPlayerData(clients[i]).ped == null) { + if(clients[i].player != null) { + getPlayerData(clients[i]).ped = clients[i].player; + onPlayerSpawn(clients[i].player); + } + } + } + } + } + } +} + // --------------------------------------------------------------------------- \ No newline at end of file