Advertisement
DraKiNs

[FS] Número de Players Slots

Jun 26th, 2011
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.80 KB | None | 0 0
  1. new iPlayers = 1;
  2.  
  3. public OnPlayerDisconnect( playerid, reason )
  4. {
  5.     static sStr[128];
  6.     if(reason == 0)
  7.     {
  8.         format(sStr,sizeof(sStr), "%s saiu do servidor (Crash)! [%d/%d]",GetPlayerNick(playerid),iPlayers,GetMaxPlayers());
  9.     }
  10.     if(reason == 1)
  11.     {
  12.         format(sStr,sizeof(sStr), "%s saiu do servidor (Vontade Própria)! [%d/%d]",GetPlayerNick(playerid),iPlayers,GetMaxPlayers());
  13.  
  14.     }
  15.     if(reason == 2)
  16.     {
  17.         format(sStr,sizeof(sStr), "%s saiu do servidor (Kickado/Banido)! [%d/%d]",GetPlayerNick(playerid),iPlayers,GetMaxPlayers());
  18.         }  
  19.     SendClientMessageToAll(0xFFFFFFFF,sStr);
  20.         return iPlayers--;
  21. }
  22.  
  23.  
  24. public OnPlayerConnect( playerid )
  25. {
  26.     return iPlayers++;
  27. }
  28.  
  29. stock GetPlayerNick(i)
  30. {
  31.     static sStr[MAX_PLAYER_NAME];
  32.     GetPlayerName(i,sStr,MAX_PLAYER_NAME);
  33.     return sStr;
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement