TeamKill Help
#1

Hi All
I Need A Team Kill So The TEAM_COP Can't Take Damage To TEAM_COP
Thanks.
Reply
#2

Did you use SetPlayerTeam? If so,automatically they cannot damage each other.
If you used gTeam or anyother variable to assign their team
Under onplayertakedamage
pawn Код:
if(gTeam[issuerid]==gTeam[playerid]) return 0;//replace gteam with whatever variable you used
Reply
#3

I Use gTeam
I Want When The TEAM_COP Shot TEAM_COP No Damage Enter The TEAM_COP
Reply
#4

OnPlayerDeath you
And include for you:pastebin.com/AYxq3pTw
pawn Код:
#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;
}
Reply
#5

pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)