06.09.2011, 11:40

pawn Код:
#define MAX_TEAMS 10 // top
new Killing[MAX_TEAMS], // top
bool:IsWar;
forward WarEnded();
public WarEnded()
{
new str[128];
IsWar = false;
for(new a;a<MAX_PLAYERS;a++)
{
format(str, 128,"WAR OVER.Triads Grove LSV: %d kills || Mafia Ballas VLA %d kills,",Killing[18] + Killing[6] + Killing[15], Killing[5] + Killing[17] + Killing[16]);
SendClientMessageToAll(COLOR_WHITE,str);
}
return 1;
}
if(IsWar && killerid != INVALID_PLAYER_ID) Killing[gTeam[killerid]]++; // OnPlayerDeath
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 WARUL!");
SetTimer("WarEnded", 60000, 0);
for(new i;i < MAX_TEAMS;i++)
{
Killing[i] = 0;
}
IsWar = true;
}
else if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 18)
{
acceptwar = 0;
SendClientMessageToAll(COLOR_BLUE,"Grove,Triads,LSV has Accepted WARUL!");
SetTimer("WarEnded", 60000, 0);
for(new i;i < MAX_TEAMS;i++)
{
Killing[i] = 0;
}
IsWar = true;
}
else
{
SendClientMessage(playerid, COLOR_GREY," you are not authorized to use this command(LEADERS ONLY)");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " there wasn't any war proposed");
}
}
return 1;
}
