Add check spawn util

This commit is contained in:
Vortrex
2021-01-15 03:42:56 -06:00
parent 41bfd2207a
commit d734b976ab

View File

@@ -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);
}
}
}
}
}
}
}
// ---------------------------------------------------------------------------