Posts: 1,767
Threads: 124
Joined: Mar 2010
Quote:
Originally Posted by Roach_
Like this:
pawn Код:
new bool:pSpawn[MAX_PLAYERS];
public OnPlayerConnect(playerid) { pSpawn[playerid] = false; return 1; }
public OnPlayerSpawn(playerid) { pSpawn[playerid] = true; return 1; }
And you use this to check if he spawned:
pawn Код:
if(!pSpawn[playerid]) return SendClientMessage(playerid, -1, "ERROR: You must Spawn to use this command.");
|
WHAT? You are using 32-bit variables which are useless because, they're holding only 1 and 0 values! That's a waste of a lot of memory! However if player died, he's not spawned then.
You can do this check by using player STATE.