05.09.2011, 18:10
Hello, I need help with some stuff, tried some methods but didn't succed.So, I made somthing, when a leader types /acceptwar, after 1 hour the war will be automatically announced over.
And the thing what I want to do is, when the leader of a faction types /acceptwar, from then on it will save every faction kills, only for 1 hour, until the war is over.And when the war is over, also announced every faction kills.
For example:
Jafet Macario types /acceptwar
-----1 hour passed
Damn, I tried some methods but didn't worked, can anyone give me some tips what functions should I use, or anything ^^ ? Thank you.
pawn Код:
if(strcmp(cmd, "/acceptwar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(acceptwar == 1)
{
if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pLeader] == 16)
{
acceptwar = 0;
SendClientMessageToAll(COLOR_BLUE,"Mafia,Ballas,VLA has accepted the WAR");
SetTimer("WarEnded", 60000, 0);
}
else if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 18)
{
acceptwar = 0;
SendClientMessageToAll(COLOR_BLUE,"Grove,Triads,LSV has accepted the war!");
SetTimer("WarEnded", 60000, 0);
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not authorized to use this command(LEADERS ONLY)");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " there were not proposed any war");
}
}
return 1;
}
pawn Код:
forward WarEnded();
public WarEnded()
{
SendClientMessageToAll(COLOR_RED,"60 Minutes has passed, WAR OVER");
return 1;
}
For example:
Jafet Macario types /acceptwar
-----1 hour passed
Код:
60 Minutes has passed,war over.Mafia Ballas VLA: 56 Kills || Grove Triads LSV 60 Kills.