Change GM on voting
#1

Hello everyone,

Im trying to create a Voting system. This system system should be callled on a Function TimeLeft10()
The Idea is:
1. Whenever a battle ends in my TDM GM. It scores++ and Shows lot of clientMessage's.
2. I want it should pop up a Dialog with three list items contianing Map name's. (LS,SF,LV)
3. When player select's one option lets say LS , It will increase one vote for LS.
4. It will work for all the player's and will count vote's for all the three Maps. The Map with highest vote's will be executed with [SendRconCommand(changemode LS) - Example]

Summary on what i want to make is:
1. Dialog with three items pop up for every player on TimeLeft10() public function.
2. When player select's one item it should increase one vote for the map.
3. Check vote's and Load the GM with highest vote's.

Post me suggestions. You can post Small code's for dialog's ,item's ,varibale for vote's,etc? I've figured some ways to code it but i cant think of any idea that exactly should i check the vote's ? and Change the GM?
Help will be appreciated by adding reputation.
Thanks

BMiaa
Reply
#2

use ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "MODES","Lv\nLs\nSf","Ok","Cancel");

and make a Voting system
Reply
#3

Quote:
Originally Posted by Spooky
Посмотреть сообщение
use ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "MODES","Lv\nLs\nSf","Ok","Cancel");

and make a Voting system
Spooky Thanks for the reply but i already know that. Dialog with 3 items can be made and i can also define what should happen when they select any item. But its hard to make the CheckVotes function or something which will change the GM. And i am even confused that where should i check the vote's to change the GM (Variables for all three Maps)
Reply
#4

I THINK WIKI.SA-MP.COM will Help and also use OnDialogResponse function.

pawn Код:
switch(dialogid)
{
     case DIALOG_ID:
     {
             if(!response)
             {
                    SendClientMessage(playerid, -1,"You canceled.");
                    return 1;
             }
             switch(listitem)
            {
                    case 0:
                    {
                            SendRconCommand("changemode Lv");
                    }
            }
     }
}
Make vote system and add in that.
Reply
#5

Quote:
Originally Posted by Spooky
Посмотреть сообщение
I THINK WIKI.SA-MP.COM will Help and also use OnDialogResponse function.

pawn Код:
switch(dialogid)
{
     case DIALOG_ID:
     {
             if(!response)
             {
                    SendClientMessage(playerid, -1,"You canceled.");
                    return 1;
             }
             switch(listitem)
            {
                    case 0:
                    {
                            SendRconCommand("changemode Lv");
                    }
            }
     }
}
Make vote system and add in that.
Nah thats wrong actually!! The Case 0 will add one vote for LS or LV or any Map which he/she will select. Then A function will count vote's and Will changemode to the GM which had the Highest vote's!
Reply
#6

So noone has any answer for me? Please help!

EDIT: You can also post a suggestion to code it!
Reply
#7

Suggestion is to create arrays and do +1 in a array when a player votes that map.then check which array is the largest and change the mode accordingly
Reply
#8

Quote:
Originally Posted by §с†¶e®РµРe
Посмотреть сообщение
Suggestion is to create arrays and do +1 in a array when a player votes that map.then check which array is the largest and change the mode accordingly
Haardik! I understand that. What do you think where should i add it according to my GM , which uve seen already?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)