Anti 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)
+--- Thread: Anti Team Kill (
/showthread.php?tid=473696)
Anti Team Kill -
lulo356 - 03.11.2013
How can you create a Anti Team Kill+where do i need to place it
Re: Anti Team Kill -
iJumbo - 03.11.2013
Please take a look at this function
https://sampwiki.blast.hk/wiki/SetPlayerTeam
and here you have a few tutorials and questions already made here where you can find some answers
Click me
Re: Anti Team Kill -
lulo356 - 03.11.2013
Quote:
Originally Posted by iJumbo
|
Well i use this one, But some gang cant kill each other (Like: Grove street cant kill cops)
Re: Anti Team Kill -
iJumbo - 03.11.2013
Maybe you are wrong in some part of your code
Re: Anti Team Kill -
lulo356 - 04.11.2013
Nope i just use the wiki thing
Re: Anti Team Kill -
iJumbo - 04.11.2013
Show that code
Re: Anti Team Kill -
iGetty - 04.11.2013
Simple as:
pawn Код:
public OnPlayerUpdate(playerid)
{
new targetplayer = GetPlayerTargetPlayer(playerid); // Store the ID
if(GetPlayerTeam(targetplayer) == GetPlayerTeam(playerid) && targetplayer != INVALID_PLAYER_ID)
{
GameTextForPlayer(playerid, "~R~do not shoot at team-mates!", 5000, 3);
}
}
and
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
new string[128], Float:hp;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp+amount);
GameTextForPlayer(playerid, "Don't shoot at team mates!", 3000, 5);
return 1;
}