21.08.2012, 12:43
I have made an anti Team killing but its have a problem
When robber shot a cop the cop recover by his own and the same when cop shot robber.
the code
When robber shot a cop the cop recover by his own and the same when cop shot robber.
the code
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
if(gTeam[playerid] == SWAT)
{
gTeam[damagedid] = SWAT;
GivePlayerMoney(playerid,-100);
SendClientMessage(playerid,COLOR_BLUE,"Stop Shooting your team mates");
SetPlayerHealth(damagedid,amount);
}
if(gTeam[playerid] == Robbers)
{
gTeam[damagedid] = Robbers;
GivePlayerMoney(playerid,-100);
SendClientMessage(playerid,COLOR_RED1,"Stop Shooting your mates");
SetPlayerHealth(damagedid,amount);
}
return 1;
}