07.02.2017, 16:40
PHP код:
new PlayerMapVote[MAX_PLAYERS];
static MapNumber;
static MapNumberP[MAX_PLAYERS];
static 1Vote;
static 2Vote;
static 3Vote;
static 4Vote;
CMD:VoteMaps(playerid, params[])
{
ShowPlayerDialog(playerid, DerbyDialogs, DIALOG_STYLE_LIST, "VoteSystem By {FF0000}Ramin[Avenger]{FFFFFF}","1\n2\n3\n4", "Vote", "Close");
SetTimerEx("FinishVote", 20000, false, "i", playerid);
return 1;
}
forward FinishVote(playerid, time);
public FinishVote(playerid, time)
{
ShowPlayerDialog( playerid, -1, 0, "", "", "", "" );
if (1 >= 2 && 1 >= 3 && 1 >= 4)
{
SendClientMessageToAll(COLOR_GREEN, "Vote:Map 1 Has Won!");
PlayerMapVote[playerid] = 0;
return 1;
}
else if(2 > 1 && 2 >= 3 && 2 >= 4)
{
SendClientMessageToAll(COLOR_GREEN, "Vote:Map 2 Has Won!");
PlayerMapVote[playerid] = 0;
return 1;
}
else if(3 > 1 && 3 > 2 && 3 >= 4)
{
SendClientMessageToAll(COLOR_GREEN, "Vote:Map 3 Has Won");
PlayerMapVote[playerid] = 0;
}
else if(4 > 1 && 4 > 2 && 4 > 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;
}
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