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


Messages In This Thread
Help antiteamkill with on/off - by Broker - 24.03.2013, 04:42
Re: Help antiteamkill with on/off - by [ABK]Antonio - 24.03.2013, 04:46

Forum Jump:


Users browsing this thread: 2 Guest(s)