Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PlayerVoting[playerid] >0)
- {
- if ((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
- {
- new string[128];
- format(string,sizeof(string),"You have voted for Map ID: %d. Please wait till voting finishes.",PlayerVoting[playerid]);
- SendClientMessage(playerid,COLOR_HEADING,string);
- MapVoted[PlayerVoting[playerid]] ++;
- return 0;
- }
- }
- return 1;
- }
- public VoteFinish()
- {
- new value,string[128];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerVoting[i] = 0;
- pTempKills[i] = 0;
- pTempDeaths[i] = 0;
- GameTextForAll("~w~ Voting has finished.~g~\nLoading next game..",4000,4);
- }
- for (new i=0; i <sizeof(MapVoted); ++i)
- {
- if (MapVoted[i] > value) value = MapVoted[i]+1; //+1 because map ids start from 1 and not 0
- sMap = value;
- format(string,sizeof(string),"Map ID: %d has been voted in.",value);
- SendClientMessageToAll(COLOR_HEADING,string);
- printf("VOTING HAS FINISHED, MAP ID: %s HAS BEEN SELECTED",sMap);
- MapVoted[i] = 0;
- VotingInProgress = false;
- ServerSetup();
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment