15.12.2013, 19:42
Hello today I was working on war sistem for gangs and know everything is fine and know In kill someone from other team and then there was send some message to one and another time that somene player was killed and set the score but is nothing happening when I kill player from another team so this is the code for onplayerdeath:
pawn Код:
//----------------------------[ WAR SYSTEM ]---------------------------------------------------------------------//
if(IsPlayerConnected(killerid) && WarAktivan == true && IgracUWaru[playerid] == 1 && IgracUWaru[killerid] == 1)
{
WarUbistava[killerid]++;
WarSmrti[playerid]++;
new wrs[128], war[128], hWarIme[2][MAX_PLAYER_NAME];
if(PlayerInfo[playerid][Clan] == PlayerInfo[killerid][Clan] || PlayerInfo[playerid][Lider] == PlayerInfo[killerid][Lider])
{
if(PlayerInfo[killerid][Clan] == WarTim1 || PlayerInfo[killerid][Lider] == WarTim1)
{
WarTim1Score -= 3;
format(wrs, sizeof wrs,"%d",WarTim1Score);
TextDrawSetString(WarTD4,wrs);
}
else
{
WarTim2Score -= 3;
format(wrs, sizeof wrs,"%d",WarTim2Score);
TextDrawSetString(WarTD5,wrs);
}
RPIme(killerid, hWarIme[0]);
RPIme(playerid, hWarIme[1]);
format(war, 128,"(war) %s je ubio svog suigraca %s.(-3 boda za njegov tim)",hWarIme[0], hWarIme[1]);
WarPoruka(0x800080FF, war);
}
if(PlayerInfo[killerid][Clan] == WarTim1 && PlayerInfo[killerid][Lider] == WarTim1 && PlayerInfo[playerid][Clan] == WarTim2 && PlayerInfo[playerid][Lider] == WarTim2)
{
WarTim1Score++;
format(wrs, sizeof wrs,"%d",WarTim1Score);
TextDrawSetString(WarTD4,wrs);
RPIme(killerid, hWarIme[0]);
RPIme(playerid, hWarIme[1]);
format(war, 128,"(war) %s je ubio protivnika %s.(+1 bod)",hWarIme[0], hWarIme[1]);
WarPoruka(0x800080FF,war);
}
else if(PlayerInfo[killerid][Clan] == WarTim2 && PlayerInfo[killerid][Lider] == WarTim2 && PlayerInfo[playerid][Clan] == WarTim1 && PlayerInfo[playerid][Lider] == WarTim1)
{
WarTim2Score++;
format(wrs, sizeof wrs,"%d",WarTim2Score);
TextDrawSetString(WarTD5,wrs);
RPIme(killerid, hWarIme[0]);
RPIme(playerid, hWarIme[1]);
format(war, 128,"(war) %s je ubio protivnika %s.(+1 bod)",hWarIme[0], hWarIme[1]);
WarPoruka(0x800080FF,war);
}
}
if(WarAktivan == true && IgracUWaru[playerid] == 1 && killerid == INVALID_PLAYER_ID)
{
if(killerid == INVALID_PLAYER_ID)
{
WarTim1Score -= 3;
format(wrs, sizeof wrs,"%d",WarTim1Score);
TextDrawSetString(WarTD4, wrs);
RPIme(killerid, hWarIme[0]);
RPIme(playerid, hWarIme[1]);
format(war, 128,"(war) %s je izvrsio samoubojstvo.(-3 boda za njegov tim).",hWarIme[0], hWarIme[1]);
WarPoruka(0x800080FF,war);
}
return 1;
}