The very basic method would be:
What you need:
pawn Код:
new votesleft;
new bool:voted[MAX_PLAYERS];
new votefor[32]; //String if voting for a mapname or just without the [32] if you use mapindexes
new votetimer = -1;
stock GetOnlinePlayers() //Search the forum or just make one yourself, should be no big problem
Then make a command with whatever system you use like this: /vote <for>
if someone calls it, check if votetimer is > 0 (=there already is a active vote)
if not, go on, else break the cmd.
Set provotes to GetOnlinePlayers() / 5 or 2 or whatever. That number is the number of players that need to vote for it to pass. Put the <for> into votefor to store what the vote is about.
Also set all elements of voted to false with a for-loop.
Then set the votetimer, make it call a function, that ends the vote (sets votetimer to -1) in any time you want. This will be the expire time of the vote.
At last make another cmd like: /voteyes. If someone types it, check if voted[playerid] is true (he already voted) or votetimer == -1 (no vote in progress). if yes, break the cmd, else go on. Set voted[playerid] to true. Decrease votesleft by 1, then check if it is 0 or lower.
If it is, the vote has passed. Set votetimer to -1 to end the vote. Now do whatever should happen (e.g. change the map to the saved votefor string).
I hope it helps, i know the text is quite ugly, but thats all i could do for the moment