Help antiteamkill with on/off
#1

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 ?
Reply
#2

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)