25.09.2018, 20:21
No, I think that where it is, it's fine. Because thanks to the timer he chooses the president and the vice president in the middle of the count.
I tried to do it that way (I have not tried it yet), but I do not know if it will work or it would be a good idea:
@Y_LESS, help me please, you have experience on this.
I tried to do it that way (I have not tried it yet), but I do not know if it will work or it would be a good idea:
PHP код:
P_INFO[TIME_START] --;
if(P_INFO[TIME_START] >= 1)
{
for(new playerid = 0, j = GetPlayerPoolSize(); playerid <= j; playerid++)
{
if(IsPlayerConnected(playerid))
{
if(Player[playerid][M_PTP] == 1)
{
if(!P_INFO[ALL_READY])
{
new president = Iter_Random(PlayersInEvent);
Iter_Remove(PlayersInEvent, president);
Player[president][PLAYER_SERVICE_SECRET] = PRESIDENT;
SendClientMessageEx(playerid, -1, "%s is the new president", Player[president][NAME]);
new vice_president = Iter_Random(PlayersInEvent);
Player[vice_president][PLAYER_SERVICE_SECRET] = VICE_PRESIDENT;
SendClientMessageEx(playerid, -1, "%s is the new vice president", Player[vice_president][NAME]);
P_INFO[ALL_READY] = true;
}
new str[10]; format(str, sizeof(str), "%d", P_INFO[TIME_START]);
GameTextForPlayer(playerid, str, 1000, 3);
}
}
}
}