SA-MP Forums Archive
Team Friendly Fire.. Need your 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: Team Friendly Fire.. Need your help. (/showthread.php?tid=456748)



Team Friendly Fire.. Need your help. - Champ - 07.08.2013

How to make team friendly fire for team mates. To disable them to decrease their own team mates.

i have this type of system

pawn Код:
if(gTeam[playerid] == TEAM1)
{
}
else if(gTeam[playerid] == TEAM2)
{
}
Please help. Urgently needed.


Re: Team Friendly Fire.. Need your help. - -Prodigy- - 07.08.2013

Use SetPlayerTeam()


Re: Team Friendly Fire.. Need your help. - Champ - 07.08.2013

but i am using gTeam feature. And where should i add this?


Re: Team Friendly Fire.. Need your help. - -Prodigy- - 07.08.2013

SetPlayerTeam is so that other players in that same team can't damage you.

You can use it like this:
pawn Код:
if(gTeam[playerid] == TEAM1)
{
    SetPlayerTeam(playerid, 1); // if the playerid is in TEAM1, we set his team to 1
}
else if(gTeam[playerid] == TEAM2)
{
    SetPlayerTeam(playerid, 2); // if the playerid is in TEAM2, we set his team to 2
}
Make sure you update that each time you change gTeam


Re: Team Friendly Fire.. Need your help. - Konstantinos - 07.08.2013

Although,
Quote:
Note: Players can not damage/kill players on the same team unless they use a knife to slit their throat. As of SA-MP 0.3x, players are also unable to damage vehicles driven by a player from the same team. This can be enabled with EnableVehicleFriendlyFire.




Re: Team Friendly Fire.. Need your help. - Champ - 07.08.2013

thank you -Prodigy-. Plus + one 1 Rep.