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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti-Team-Kill (
/showthread.php?tid=261548)
Anti-Team-Kill -
0_o - 14.06.2011
How to Make a Anti-Team_kill Using
Re: Anti-Team-Kill -
Basicz - 14.06.2011
Take a look :
pawn Код:
enum E_TEAMS ( <<= 1 )
{
TEAM_VAGOS,
TEAM_GROVE
}
new E_TEAMS: gTeam[ MAX_PLAYERS ] = { TEAM_VAGOS, ... };
public OnPlayerRequestClass( playerid, classid )
{
switch ( classid )
{
case 0: gTeam[ playerid ] = TEAM_VAGOS;
}
return 1;
}
public OnPlayerDeath( playerid, killerid, reason )
{
if ( gTeam[ killerid ] == gTeam[ playerid ] )
{
GameTextForPlayer( killerid, "~w~BANNED FOR TEAMKILLING", 1000, 3 );
Ban( killerid );
}
return 1;
}
Re: Anti-Team-Kill -
Pghpunkid - 14.06.2011
Or, you can just set them to the same team... SetPlayerTeam
When using SetPlayerTeam (last time i checked) it disables damage to teammates.