SA-MP Forums Archive
TeamKill Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TeamKill Help (/showthread.php?tid=519191)



TeamKill Help - M0HAMMAD - 13.06.2014

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


Re: TeamKill Help - DavidBilla - 13.06.2014

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



Re: TeamKill Help - M0HAMMAD - 14.06.2014

I Use gTeam
I Want When The TEAM_COP Shot TEAM_COP No Damage Enter The TEAM_COP


Re: TeamKill Help - MacT - 14.06.2014

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;
}



Re: TeamKill Help - tandytanz - 14.06.2014

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;
}