Help antiteamkill with on/off - 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 antiteamkill with on/off (
/showthread.php?tid=424912)
Help antiteamkill with on/off -
Broker - 24.03.2013
hello guys, i make a script antiteamkill.. look the code
pawn Код:
new teamkill = 1;
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
if(teamkill == 1)
{
if ( Shooter != INVALID_PLAYER_ID )
{
if ( GetPlayerTeam( Target ) == GetPlayerTeam( Shooter ) ) // check if the victim is from the same team as the shooter.
{
new Float:hp;
GetPlayerHealth(Target, hp);
SetPlayerHealth(Target, hp + HealthLost);
SetPlayerHealth( Shooter, 0 );
}
}
}
return 1;
}
CMD:tm(playerid, params[])
{
if(admin[playerid] == 1)
{
if (!teamkill)
{
teamkill = 1;
SendClientMessageToAll(COLOR_LIGHTBLUE, "Teamkill enable by admin!");
}
else
{
teamkill = 0;
SendClientMessageToAll(COLOR_LIGHTBLUE, "Teamkill disable by admin!");
}
}
else
{
GameTextForPlayer(playerid, "~b~You Are Not Admin", 1000, 3);
}
return 1;
}
but, its not work.. how to fix it ?
Re: Help antiteamkill with on/off -
[ABK]Antonio - 24.03.2013
https://sampwiki.blast.hk/wiki/SetPlayerTeam
^^^
Set their team to 255 inside of the /tm cmd to disable the teams
Still not sure why people think they should use things that they don't need to use to try and re-create the already existing setplayerteam