SA-MP Forums Archive
Team Kill - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team Kill (/showthread.php?tid=106470)



Team Kill - Ironboy500 - 03.11.2009

Code to disable Team Killing?


Re: Team Kill - Lajko1 - 03.11.2009

amm ? you should tell us a bit more lol


Re: Team Kill - Sergei - 03.11.2009

SetPlayerTeam


Re: Team Kill - Ironboy500 - 03.11.2009

Yes I have Teams and all, but I would like to disable Team Killing, so TEAM_POLICE cant kill TEAM_POLICE!


Re: Team Kill - gemadon - 03.11.2009

Umm, you can create a punishment for players that team kill.

like

Код:
if(Team[playerid] == Team[killerid])
{
//Do something here
}
return 1;
}



Re: Team Kill - Peter_Corneile - 03.11.2009

pawn Код:
if(gTeam[playerid] == gTeam[killerid])
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(killerid,X,Y,Z);
CreateExplosion(X,Y,Z,7,20);
SetPlayerHealth(killerid,0);
GameTextForPlayer(killerid,"~r~ Do not Team Kill",3000,1);
}
Add this under OnPlayerDeath


Re: Team Kill - Ironboy500 - 03.11.2009

Nah, I know that, but I need code that player cant team kill. Any more help?


Re: Team Kill - Peter_Corneile - 03.11.2009

pawn Код:
if(gTeam[playerid] == gTeam[killerid])
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(killerid,X,Y,Z);
CreateExplosion(X,Y,Z,7,20);
SetPlayerHealth(killerid,0);
GameTextForPlayer(killerid,"~r~ Do not Team Kill",3000,1);
}
Add this under OnPlayerDeath

And if you want that when you shoot the player , health does not go down then you dont have to do anything because as you mentioned above that you already have teams defined , so they cant kill each other already


Re: Team Kill - MadeMan - 03.11.2009

You have to set your teams with SetPlayerTeam. That's all.

https://sampwiki.blast.hk/wiki/SetPlayerTeam


Re: Team Kill - Ironboy500 - 03.11.2009

ah, ok than, thanks