SA-MP Forums Archive
Onplayerdeath and afk kill - 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: Onplayerdeath and afk kill (/showthread.php?tid=490500)



Onplayerdeath and afk kill - Bogdanphr - 26.01.2014

Hello, i have a question, on my server is a one bug he is: Player death received x4 or x5 message...
This is my onplayergivedamage.
I need kill afk player
PHP код:
public OnPlayerGiveDamage playeriddamagedidFloatamountweaponid )
{
    if ( 
damagedid == INVALID_PLAYER_ID ) return 1;
    new
        
FloatHP,
        
FloatAP
    
;
    
GetPlayerHealth damagedidHP );
    
GetPlayerArmour damagedidAP );
    if ( 
AP >= amount )
    {
        
SetPlayerArmour damagedidAP amount );
    }
    else if ( 
AP <= )
    {
        new const 
FloatremainHP HP amount;
        
SetPlayerHealth damagedidremainHP );
        if ( 
remainHP <= OnPlayerDeath damagedidplayeridweaponid );
    }
    else
    {
        new const 
FloatremainHP HP + ( AP amount );
        
SetPlayerArmour damagedid0.0 );
        
SetPlayerHealth damagedidremainHP );
        if ( 
remainHP <= OnPlayerDeath damagedidplayeridweaponid );
    }
    if(
damagedid != INVALID_PLAYER_ID && weaponid == 34)
    {
        
SetPlayerHealth(damagedid0.0);
    }
    return 
1;




Re: Onplayerdeath and afk kill - Manyula - 27.01.2014

I don't get what you're aiming at.
What is the code supposed to do, and what is is actually doing? Any errors?


Re: Onplayerdeath and afk kill - Scottas - 27.01.2014

You don't have to call OnPlayerDeath if players HP is 0, because it's automaticaly called when player dies.


Re: Onplayerdeath and afk kill - Bogdanphr - 27.01.2014

if the player is afk onplayerdeath not called and afk player hp down with 50%

Onplayerdeath send spam with message for automatic weapons http://s12.postimg.org/5op5b3uhp/sa_mp_004.png


Re: Onplayerdeath and afk kill - Bogdanphr - 27.01.2014

BUMP