Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //variavel responsavรฉl pelo numero de Players :)
- new MaiorID;
- //Callback que faz a contagem de players
- forward CountPlayers();
- public CountPlayers()
- {
- new
- Players,
- IdCounter
- ;
- for(new i = 0; i < MaiorID; i++){
- if(IsPlayerConnected(i)){
- Players++;
- if(i > IdCounter){
- IdCounter = i;
- }
- }
- }
- MaiorID = (Players+3);
- return Players;
- }
- //teste
- /*
- vocรช pode tanto usar as loops comuns ou essa Loop fazendo o seguinte :
- for(new i = 0; i < MaiorID; i++){
- }
- */
- //Ongamemodeinit
- MaiorID = MAX_PLAYERS; // da um valor inicial a variavel ..
- SetTimer("CountPlayers", 2000, true); //Timer para reposicionar o valor da variavel e deixala sempre leve
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement