12.12.2012, 19:38
Hello, I'm having some troubles with some commands, in every command i check if the player is spawned, if the spawned variable is equal to 0 he is not spawned and therefore i will send a error. In the public 'OnPlayerConnect' and 'OnPlayerDisconnect' I set the players variable of spawned to 0 (Not spawned). In the public 'OnPlayerSpawn' I've set the variable to of course 1 (Spawned).
The problem is that even when i spawn it still thinks that I'm not...
The problem is that even when i spawn it still thinks that I'm not...
pawn Code:
public OnPlayerConnect(playerid)
{
Spawned[playerid] = 0;
public OnPlayerDisconnect(playerid, reason)
{
Spawned[playerid] = 0;
public OnPlayerSpawn(playerid)
{
Spawned[playerid] = 1;
if(Spawned[playerid] == 0) return SendClientMessage(playerid, COLOR_RED2, "[ERROR] :{FFFFFF} You need to spawn before you use any commands.");