Vote System +Rep
#1

PHP код:
new PlayerMapVote[MAX_PLAYERS];
static 
MapNumber;
static 
MapNumberP[MAX_PLAYERS];
static 
1Vote;
static 
2Vote;
static 
3Vote;
static 
4Vote;
CMD:VoteMaps(playeridparams[])
{
        
ShowPlayerDialog(playeridDerbyDialogsDIALOG_STYLE_LIST"VoteSystem By {FF0000}Ramin[Avenger]{FFFFFF}","1\n2\n3\n4""Vote""Close");
        
SetTimerEx("FinishVote"20000false"i"playerid);
    return 
1;
}
forward FinishVote(playeridtime);
public 
FinishVote(playeridtime)
{
    
ShowPlayerDialogplayerid, -10"""""""" );
    if (
>= && >= && >= 4)
    {
        
SendClientMessageToAll(COLOR_GREEN"Vote:Map 1 Has Won!");
        
PlayerMapVote[playerid] = 0;
                return 
1;
        }
    else if(
&& >= && >= 4)
        {
                
SendClientMessageToAll(COLOR_GREEN"Vote:Map 2 Has Won!");
                
PlayerMapVote[playerid] = 0;
                return 
1;
        }
        else if(
&& && >= 4)
     {
            
SendClientMessageToAll(COLOR_GREEN"Vote:Map 3 Has Won");
            
PlayerMapVote[playerid] = 0;
        }
    else if(
&& && 3)
    {
            
SendClientMessageToAll(COLOR_GREEN"Vote:Map 4 Has Won");
            
PlayerMapVote[playerid] = 0;
    }
    
PlayerDerbyVote[playerid] = 0;
    
1Vote 0;
    
2Vote 0;
        
3Vote 0;
    
4Vote 0;
    
MapNumber 0;
    
MapNumberP[playerid] = 0;
}
    if(
dialogid == DerbyDialogs)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                new 
string[64], pName[MAX_PLAYER_NAME];
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                 
format(string,sizeof string,"%s Voted 1.",pName);
                
SendClientMessageToAll(0xFF9900AA,string);
                
1Vote += 1;
                
PlayerMapVote[playerid] = 1;
                
MapNumber += 1;
                 
MapNumberP[playerid] = MapNumber;
            }
            if(
listitem == 1)
            {
                new 
string[128], pName[MAX_PLAYER_NAME];
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
format(string,sizeof string,"%s Voted 2.",pName);
                
SendClientMessageToAll(0xFF9900AA,string);
                 
2Vote += 1;
                 
PlayerMapVote[playerid] = 1;
                 
MapNumber += 1;
                 
MapNumberP[playerid] = MapNumber;
            }
            if(
listitem == 2)
            {
                new 
string[128], pName[MAX_PLAYER_NAME];
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
format(string,sizeof string,"%s Voted 3.",pName);
                
SendClientMessageToAll(0xFF9900AA,string);
                
3Vote += 1;
                
PlayerMapVote[playerid] = 1;
                
MapNumber += 1;
                
MapNumberP[playerid] = MapNumber;
            }
            if(
listitem == 3)
            {
                new 
string[128], pName[MAX_PLAYER_NAME];
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
format(string,sizeof string,"%s Voted 4.",pName);
                
SendClientMessageToAll(0xFF9900AA,string);
                
4Vote += 1;
                
PlayerMapVote[playerid] = 1;
                
MapNumber += 1;
                
MapNumberP[playerid] = MapNumber;
            }
        }
        return 
1;
    } 
i Maked This Algoritm For Vote Map by players But i don't know how i can Use SetTimerEx For All Player Equal
in this Code When Player Choose 1 20 Second Begin for him And When Next Player Choose 2 new Timer Begin for him . In Result Two Message come to all Vote:Map 1 Has Won - Vote:Map 2 Has Won
i want One timer for all Equal
Please Compelete my Codes <3 Thank you
Reply


Messages In This Thread
Vote System +Rep - by Ramin - 07.02.2017, 16:40
Re: Vote System +Rep - by jlalt - 07.02.2017, 17:28
Re: Vote System +Rep - by Ramin - 07.02.2017, 17:51

Forum Jump:


Users browsing this thread: 1 Guest(s)