Guest User

Untitled

a guest
Jan 12th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2. {
  3. if(PlayerVoting[playerid] >0)
  4. {
  5. if ((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
  6. {
  7. new string[128];
  8. format(string,sizeof(string),"You have voted for Map ID: %d. Please wait till voting finishes.",PlayerVoting[playerid]);
  9. SendClientMessage(playerid,COLOR_HEADING,string);
  10. MapVoted[PlayerVoting[playerid]] ++;
  11. return 0;
  12.  
  13. }
  14. }
  15. return 1;
  16. }
  17.  
  18. public VoteFinish()
  19. {
  20. new value,string[128];
  21. for(new i = 0; i < MAX_PLAYERS; i++)
  22. {
  23. PlayerVoting[i] = 0;
  24. pTempKills[i] = 0;
  25. pTempDeaths[i] = 0;
  26. GameTextForAll("~w~ Voting has finished.~g~\nLoading next game..",4000,4);
  27. }
  28. for (new i=0; i <sizeof(MapVoted); ++i)
  29. {
  30. if (MapVoted[i] > value) value = MapVoted[i]+1; //+1 because map ids start from 1 and not 0
  31. sMap = value;
  32. format(string,sizeof(string),"Map ID: %d has been voted in.",value);
  33. SendClientMessageToAll(COLOR_HEADING,string);
  34. printf("VOTING HAS FINISHED, MAP ID: %s HAS BEEN SELECTED",sMap);
  35. MapVoted[i] = 0;
  36. VotingInProgress = false;
  37. ServerSetup();
  38. }
  39. return 1;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment