Anti-Lag Shoot Problem
#4

If you really want normal kill prints use this

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount)
{
    if(!(0 <= damagedid < MAX_PLAYERS)) return; // small anti against cheaters

    new Float:health, Float:armour;
    GetPlayerArmour(damagedid, armour);

    if( armour < 0.1 ) // No armour, just take health
    {
        GetPlayerHealth(damagedid, health);
        health -= amount;
        if(health < 0.0)
        {
            OnPlayerDeath(damagedid, playerid, GetPlayerWeapon(playerid)); // if you want call OnPlayerDeath only in GM ( Example 1 )
            CallLocalFunction("OnPlayerDeath", "iii", damagedid, playerid, GetPlayerWeapon(playerid)); // if you want call OnPlayerDeath only in GM ( Example 2 )
            CallRemoteFunction("OnPlayerDeath", "iii", damagedid, playerid, GetPlayerWeapon(playerid)); // if you want call OnPlayerDeath in all FS and GM
            // Choose one method
            return;
        }

        SetPlayerHealth(damagedid, health);
        return;
    }
    else // There is armour, take what is needed
    {
        health = ( armour - amount );
        if( health < 0.0 ) // Health needs to be taken
        {
            GetPlayerHealth(damagedid, health);
            health -= ( amount - armour );
            SetPlayerHealth(damagedid, health);
            SetPlayerArmour(damagedid, 0.0);
        }
        else
            SetPlayerArmour(damagedid, health);
    }
    return;
}
but i dont know is this a good idea
Reply


Messages In This Thread
Anti-Lag Shoot Problem - by Petry - 29.09.2013, 07:09
Re: Anti-Lag Shoot Problem - by Petry - 30.09.2013, 11:19
Re: Anti-Lag Shoot Problem - by Stereotype - 30.09.2013, 11:31
Re: Anti-Lag Shoot Problem - by Jefff - 30.09.2013, 15:22
Re: Anti-Lag Shoot Problem - by Pottus - 30.09.2013, 16:10
Re: Anti-Lag Shoot Problem - by Jefff - 30.09.2013, 16:17
Re: Anti-Lag Shoot Problem - by Pottus - 30.09.2013, 16:23
Re: Anti-Lag Shoot Problem - by Jefff - 30.09.2013, 16:25
Re: Anti-Lag Shoot Problem - by Pottus - 30.09.2013, 16:26

Forum Jump:


Users browsing this thread: 4 Guest(s)