How To: check if its the player's first spawn
#3

pawn Код:
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;
}
I've used the normal arrays here, you can easily change it to P-vars (new functions) if you want to.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)