Zinne91

Untitled

Dec 4th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. COMMAND:startround(playerid, params[])
  2. {
  3. new str[128], playerList[256], tmp[16], strpos, totalFighters, fighter1, fighter2;
  4. for(new i; i < MAX_PLAYERS; i++) {
  5. if(!IsPlayerConnected(i))continue;
  6. if(!inEvent[i])continue;
  7. if(eventFights[i] != foughtRounds)continue;
  8. if(i < 10) { format(tmp, sizeof(tmp), "%02d|", i); } else { format(tmp, sizeof(tmp), "%d|", i); }
  9. totalFighters++;
  10. strcat(playerList, tmp);
  11. }
  12. fighter1 = random(totalFighters);
  13. if(fighter1 < 10) { format(tmp, sizeof(tmp), "%02d", fighter1); } else { format(tmp, sizeof(tmp), "%d", fighter1); }
  14. strpos = strfind(playerList, strval(fighter1));
  15. fighter1 = strmid(tmp, playerList, strpos, strpos+3);
  16. return 1;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment