Advertisement
ipsBruno

(Pawn) Loop rápido sobre jogadores

Oct 13th, 2013
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. new Each:Players[ MAX_PLAYERS ] ;
  2.  
  3. public OnPlayerDisconnect(playerid) {
  4.  
  5.     if(!IsPlayerNPC(playerid)) EachRemove(Players, playerid );
  6.  
  7.     return true;
  8. }
  9.  
  10. public OnPlayerConnect(playerid) {
  11.  
  12.     if(!IsPlayerNPC(playerid)) EachAdd(Players, playerid );
  13.    
  14.     return true;
  15. }
  16.  
  17.  
  18. public OnPlayerSpawn(playerid) {
  19.  
  20.     printf("Mais um jogador spawno, agora são: %d jogadores no nosso servidor", EachCount(Players));
  21.    
  22.    
  23.     each(Players->new i) { // LOOP SUPER RAPIDO SOBRE TODOS JOGADORES CONECTADOS
  24.         SendClientMessage(i, -1, "Mais um jogador entrou no nosso servidor !!!");
  25.     }
  26.    
  27.     return true;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement