Onplayerdeath and afk kill
#1

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;

Reply
#2

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

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

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
Reply
#5

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)