Anti team kill delay problem!!(rep+)
#10

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if ( playerid != INVALID_PLAYER_ID )
    {
        if ( gTeam[damagedid] == gTeam[playerid] ) // check if the victim is from the same team as the playerid.
        {
            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_INDIA && gTeam[playerid] == TEAM_INDPM ) // check if the victim is from the same team as the playerid.
        {
            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_INDPM && gTeam[playerid] == TEAM_INDIA ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_USA && gTeam[playerid] == TEAM_USPM ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_USPM && gTeam[playerid] == TEAM_USA ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_RUSSIA && gTeam[playerid] == TEAM_RUSPM ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_RUSPM && gTeam[playerid] == TEAM_RUSSIA ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_PAK && gTeam[playerid] == TEAM_PAKPM ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_PAKPM && gTeam[playerid] == TEAM_PAK ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_UK && gTeam[playerid] == TEAM_UKPM ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
        if ( gTeam[damagedid] == TEAM_UKPM && gTeam[playerid] == TEAM_UK ) // check if the victim is from the same team as the playerid.
        {

            new Float:hp;
            new Float:ap;
            GetPlayerHealth(damagedid, hp);
            SetPlayerHealth(damagedid, hp + amount);
            GetPlayerArmour(damagedid, ap);
            SetPlayerArmour(damagedid, ap + amount);
            SendClientMessage( playerid, COLOR_RED, "Team killing is not allowed!" );
        }
    }
    return 1;
}
try something like this..
Reply


Messages In This Thread
Anti team kill delay problem!!(rep+) - by Ballu Miaa - 17.12.2011, 12:44
Re: Anti team kill delay problem!!(rep+) - by Mrki_Drakula - 17.12.2011, 12:51
Re: Anti team kill delay problem!!(rep+) - by wildcookie007 - 17.12.2011, 12:51
Re: Anti team kill delay problem!!(rep+) - by kizla - 17.12.2011, 12:52
Re: Anti team kill delay problem!!(rep+) - by Ballu Miaa - 17.12.2011, 12:53
Re: Anti team kill delay problem!!(rep+) - by suhrab_mujeeb - 17.12.2011, 12:55
Re: Anti team kill delay problem!!(rep+) - by Ballu Miaa - 17.12.2011, 12:55
Re: Anti team kill delay problem!!(rep+) - by Ballu Miaa - 17.12.2011, 12:59
Re: Anti team kill delay problem!!(rep+) - by [ABK]Antonio - 17.12.2011, 13:16
Re: Anti team kill delay problem!!(rep+) - by kizla - 17.12.2011, 20:50

Forum Jump:


Users browsing this thread: 3 Guest(s)