Advertisement
DraKiNs

[COD] Pegar jogador Random

Aug 10th, 2011
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.33 KB | None | 0 0
  1. //Pegar jogador de forma random.
  2.  
  3. RandomPlayer()
  4. {
  5.     new Arr[MAX_PLAYERS] = {-1, ...}, x = 0;
  6.     for(new i; i != MAX_PLAYERS; i++)
  7.     {
  8.         if(IsPlayerConnected( i )) Arr[x] = i, ++x;
  9.     }
  10.     return !x ? -1 : Arr[random( x )] ;
  11. }
  12.  
  13. // Não trava servidor
  14. // Está bem otimizado
  15. // Criado por Bruno da Silva
  16. // www.ips-team.blogspot.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement