I have a problem on player kill count , idk how to add that player kill counter to those cmds . Here is the /startwar and /acceptwar :
Code:
if(strcmp(cmd, "/startwar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(wtimer[playerid] < 1)
{ }
else
{
SendClientMessage(playerid, COLOR_GREY, "You must wait 12 hours for every war");
return 1;
}
if(PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 15)
{
acceptwar = 1;
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /startwar list , /startwar [locul]");
return 1;
}
if(strcmp(x_nr,"list",true) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "_________Locuri_List_________");
SendClientMessage(playerid, COLOR_GRAD1, "1:GS/LS 2: BS/LS 3: Madd Dog House");
return 1;
}
else if(strcmp(x_nr,"1",true) == 0)
{
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
SendClientMessageToAll(COLOR_GREEN, "{D3D3D3}Triads-LSV-Grove {00FA9A}au declarat WAR , zona: {FFFFFF}GS/LS");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
return 1;
}
else if(strcmp(x_nr,"2",true) == 0)
{
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
SendClientMessageToAll(COLOR_GREEN, "{D3D3D3}Triads-LSV-Grove {00FA9A}au declarat WAR , zona: {FFFFFF}BS/LS");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
return 1;
}
else if(strcmp(x_nr,"3",true) == 0)
{
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
SendClientMessageToAll(COLOR_GREEN, "{D3D3D3}Triads-LSV-Grove {00FA9A}au declarat WAR , zona: {FFFFFF}Madd Dog House");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
return 1;
}
}
else if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pLeader] == 16)
{
acceptwar = 1;
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /startwar list , /startwar [locul]");
return 1;
}
if(strcmp(x_nr,"list",true) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "_________Locuri_List_________");
SendClientMessage(playerid, COLOR_GRAD1, "1: GS/LS 2: BS/LS 3: Madd Dog House");
return 1;
}
else if(strcmp(x_nr,"1",true) == 0)
{
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
SendClientMessageToAll(COLOR_GREEN, "{D3D3D3}Mafia-VLA-Ballas {00FA9A}au declarat WAR , zona: {FFFFFF}GS/LS");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
return 1;
}
else if(strcmp(x_nr,"2",true) == 0)
{
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
SendClientMessageToAll(COLOR_GREEN, "{D3D3D3}Mafia-VLA-Ballas {00FA9A}au declarat WAR , zona: {FFFFFF}BS/LS");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
return 1;
}
else if(strcmp(x_nr,"3",true) == 0)
{
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
SendClientMessageToAll(COLOR_GREEN, "{D3D3D3}Mafia-VLA-Ballas {00FA9A}au declarat WAR , zona: {FFFFFF}Madd Dog House");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Provocation________|");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You are not a gang / mafia leader!");
return 1;
}
wtimer[playerid] = 3000000;
}
return 1;
}
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,"{00FA9A}|__________WAR Started__________|");
SendClientMessageToAll(COLOR_BLUE,"{D3D3D3}Mafia-VLA-Ballas {00FA9A}au acceptat WARUL!");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}Va rugam , evitati acea zona!");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|__________WAR Started__________|");
SetTimer("WarEnded", 1800000, 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,"{00FA9A}|__________WAR Started__________|");
SendClientMessageToAll(COLOR_BLUE,"{D3D3D3}Triads-LSV-Grove {00FA9A}au acceptat WARUL!");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}Va rugam , evitati acea zona!");
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|__________WAR Started__________|");
SetTimer("WarEnded", 1800000, 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;
}
and the war over is here :
Code:
forward WarEnded();
public WarEnded()
{
new str[128];
IsWar = false;
format(str, 128,"{00FA9A}|________WAR Finished________|");
SendClientMessageToAll(COLOR_WHITE,str);
format(str, 128,"{D3D3D3}TheTriads-LSV-Grove {00FA9A}Score: %d kills || {D3D3D3}The Mafia-VLA-Ballas {00FA9A}Score: %d kills,",Killing[18] + Killing[6] + Killing[15], Killing[5] + Killing[17] + Killing[16]);
SendClientMessageToAll(COLOR_WHITE,str);
format(str, 128,"{00FA9A}Membrii aliantei castigatoare au primit 5000 mats, 500 drugs si $50.000 pentru castigarea warului!");
SendClientMessageToAll(COLOR_WHITE,str);
format(str, 128,"{00FA9A}|________WAR Finished________|");
SendClientMessageToAll(COLOR_WHITE,str);
if(Killing[18] + Killing[6] + Killing[15] > Killing[5] + Killing[16] + Killing[17])
{
for(new a; a<MAX_PLAYERS;a++)
{
if(PlayerInfo[a][pLeader] == 18 || PlayerInfo[a][pLeader] == 6 || PlayerInfo[a][pLeader] == 15 || PlayerInfo[a][pMember] == 18
|| PlayerInfo[a][pMember] == 6 || PlayerInfo[a][pMember] == 16)
{
PlayerInfo[a][pMats] += 5000;
PlayerInfo[a][pDrugs] += 500;
GivePlayerMoney(a, 50000);
}
}
}
else
{
for(new k; k<MAX_PLAYERS;k++)
{
if(PlayerInfo[k][pLeader] == 5 || PlayerInfo[k][pLeader] == 16 || PlayerInfo[k][pLeader] == 17 || PlayerInfo[k][pMember] == 5
|| PlayerInfo[k][pMember] == 16 || PlayerInfo[k][pMember] == 17)
{
PlayerInfo[k][pMats] += 5000;
PlayerInfo[k][pDrugs] += 500;
GivePlayerMoney(k, 50000);
}
}
}
for(new i;i<MAX_TEAMS;i++)
{
Killing[i] = 0;
}
return 1;
}
How cand i add what you said on those cmd to do something like this : 1. When the leader accepts the provocation of war , to start automatically count kills of player team . 2. Then after 30 minutes , the war is automatically closed and show the frags , i want to show the best player frags . Can you help me ?
I need to know where to put those lines who you give it to me.
srry for my bad english !