[TUTORIAL] Correct MAX_PLAYERS: gMaxPlayers. Reduced timeouts.
#8

I use the code in we LSTD mode.

Here Kowalski's code:

pawn Код:
new HighestID;

public OnPlayerConnect(playerid)
{
  if(HighestID < playerid) HighestID = playerid;
  return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
  if(HighestID == playerid)
  {
    for(new i = playerid-1; i >= 0; i--)
    {
      if(IsPlayerConnected(i))
      {
        HighestID = i;
        break;
      }
    }
  }
  return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)