28.03.2010, 19:45
How do i do it?
new
playerSpawn[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(playerSpawn[playerid] == 0)
{
// first spawn.
playerSpawn[playerid] = 1; // player was spawned for the first time, now we'll set the variable to true.
}
else
{
// it's not his first spawn.
}
return true;
}
public OnPlayerDisconnect(playerid, reason)
{
playerSpawn[playerid] = 0; // reset the variable when player disconnects.
return true;
}
new FirstSpawn[MAX_PLAYERS];
stock FirstTimeSpawning(playerid, type) { if (type == 0) //not the first time { FirstSpawn[playerid] = 0; } if (type == 1) //First time { FirstSpawn[playerid] = 1; } return 1; }
C:\Documents and Settings\Wouter\Bureaublad\Sa-MP Scripting\pawno\NG-RP.pwn(123) : warning 211: possibly unintended assignment
if(FirstSpawn[playerid] = 1)
if(FirstSpawn[playerid] == 1)