14.11.2017, 20:37
PHP Code:
if(killerid != INVALID_PLAYER_ID)
{
PlayerInfo[killerid][pKills] += 1;
//WAR SISTEM
new xs[200];
if(IsPlayerConnected(killerid) && is_war_active == true && player_in_war[playerid] == 1 && player_in_war[killerid] == 1)
{
if(PlayerInfo[playerid][pMember] == PlayerInfo[killerid][pMember])
{
if(PlayerInfo[killerid][pMember] == War_T1) War_T1_Score--;
else if(PlayerInfo[killerid][pMember] == War_T2) War_T2_Score--;
format(xs, 200, "* %s killed his teammate. His faction lose 1 point.", GetName(killerid));
SendClientMessage(playerid, COLOR_INFO, xs);
//IgracSkorUbistva[killerid]--,
}
if(PlayerInfo[killerid][pMember] == War_T1 && PlayerInfo[playerid][pMember] == War_T2)
{
War_T1_Score++;
//IgracSkorUbistva[killerid]++;
//IgracSkorSmrti[playerid]++;
}
else if(PlayerInfo[killerid][pMember] == War_T2 && PlayerInfo[playerid][pMember] == War_T1)
{
War_T2_Score++;
//IgracSkorUbistva[killerid]++;
//IgracSkorSmrti[playerid]++;
}
foreach (new i : Player)
{
if(gPlayerLogged[i] == 1 && IsPlayerConnected(i))
{
if(player_in_war[i] == 1)
{
SendDeathMessageToPlayer(i, killerid, playerid, reason);
}
}
}
}
}
Also I have a question, because SendDeathMessage is spamming and it works correctly. How to delete 'log' when the war is over.
Command for score:
PHP Code:
YCMD:score(playerid, params[],help)
{
#pragma unused help
if(player_in_war[playerid] == 1)
{
new scoremsg[200];
format(scoremsg, 200, "* Team #1 (%s): %d {EE3939}/// {FFFFFF}Team #2 (%s): %d {EE3939}/// {FFFFFF}Do kraja rata: %s", GetOrgName(War_T1), War_T1_Score, GetOrgName(War_T2), War_T1_Score, SecToMin(War_Time));
SendClientMessage(playerid, COLOR_WHITE, scoremsg);
}
return 1;
}