[HELP] Anti-Kill for teams. - 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: [HELP] Anti-Kill for teams. (
/showthread.php?tid=619867)
[HELP] Anti-Kill for teams. -
StrikerZ - 23.10.2016
Hi there, is there any way in which a team member can't kill his own other team member? Like i have 6 classes. Army,swat,fbi,cops,terror and robbers. Is there any way in which army fbi swat cops can't shoot each other?
Re: [HELP] Anti-Kill for teams. -
henkas - 23.10.2016
Under OnPlayerSpawn where You setting team one data put there
SetPlayerTeam(playerid,0);
and where u using 2nd team put there
SetPlayerTeam(playerid,1);
Just like this
Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 4)
{
new form[123];
Red[playerid] = 1;
SetPlayerTeam(playerid,1);
format(form,sizeof(form),"%s Has Spawned As Red Team",pName(playerid));
}
if(GetPlayerSkin(playerid) == 5)
{
new form[123];
Blue[playerid] = 1;
SetPlayerTeam(playerid,2);
format(form,sizeof(form),"%s Has Spawned As Blue Team",pName(playerid));
}
SetPlayerInterior(playerid,0);
return 1;
}
Now players wont be able to damage their teammates.
Re: [HELP] Anti-Kill for teams. -
StrikerZ - 23.10.2016
Ty.