SA-MP Forums Archive
Need a Anti-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: Need a Anti-Kill (/showthread.php?tid=412711)



Need a Anti-Kill - DerickClark - 02.02.2013

Team_Army
Team_Cop


Re: Need a Anti-Kill - T0pAz - 02.02.2013

Try this.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if((killerid != INVALID_PLAYER_ID) && (GetPlayerTeam(killerid) == GetPlayerTeam(playerid)))
    {
        SendClientMessage(playerid, -1, "You have been kicked for killing your own teammate.");
        return Kick(playerid);
    }
   
    return 1;
}



Re: Need a Anti-Kill - DerickClark - 02.02.2013

My Team are
Team_Army
Team_Cop
where i put the team


Re: Need a Anti-Kill - T0pAz - 02.02.2013

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
My Team are
Team_Army
Team_Cop
where i put the team
Try that first.


Re: Need a Anti-Kill - DerickClark - 02.02.2013

i don't wanna the kick one
Team_Army
Team_Cop
Can't kill team
its something like dis
https://sampforum.blast.hk/showthread.php?tid=409297
Код:
 if(gTeam[playerid] == Team_Cop || gTeam[playerid] == Team_Army || gTeam[playerid] == Team_FBI)
	    {
	        format(string, 120, "%s was killed by %s (%s)", PlayerInfo(playerid), PlayerInfo(killerid), aWeaponNames[reason]);
			print(string);
			return 1;
		}



Re: Need a Anti-Kill - Bakr - 02.02.2013

Why are you using a variable to store the player's team ID? There are perfectly good Set/GetPlayerTeam functions. Setting the players' teams will also not allow them to kill each other.