13.06.2014, 08:59
Hi All
I Need A Team Kill So The TEAM_COP Can't Take Damage To TEAM_COP
Thanks.
I Need A Team Kill So The TEAM_COP Can't Take Damage To TEAM_COP
Thanks.
if(gTeam[issuerid]==gTeam[playerid]) return 0;//replace gteam with whatever variable you used
#include <OPSP> // add to top
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
if(gTeam[Shooter] == gTeam[Target])
{
new msg[128],name1[24],name2[24];
GetPlayerName(Shooter,name1,24);
GetPlayerName(Target,name2,24);
format(msg,sizeof(msg)," *You %s cant shoot teammate%s!",name1,name2);
SendClientMessageToAll(0xFFFFFFFF,msg);
return 1;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(gTeam[playerid] == gTeam[hitid])
{
new Float:Damage[MAX_PLAYERS];
Damage[hitid] = GetPlayerHealth(hitid);
SetPlayerHealth(playerid, Damage);
Damage[hitid] = GetPlayerArmour(hitid);
SetPlayerArmour(playerid, Damage);
}
return 0;
}