How to fix damage weapons
#3

PHP код:
#define deagle_damage 23
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 24)
    {
        new 
Float:hpFloat:apFloat:damageleft;
        
GetPlayerArmour(playeridap);
        
GetPlayerHealth(playeridhp);
        if(
ap deagle_damage)
        {
            
damageleft deagle_damage ap;
            
SetPlayerArmour(playerid0);
            
SetPlayerHealth(playeridhp-damageleft);
            return 
1;
        }
        
SetPlayerHealth(playeridhp+amount);
        
SetPlayerHealth(playeridhp-deagle_damage);
    }
    return 
1;

I believe it could cause bugs, I'd recommend you in this case to just create server-sided HP
Reply


Messages In This Thread
How to fix damage weapons - by ducmcmca1 - 08.01.2018, 04:19
Re: How to fix damage weapons - by Abagail - 08.01.2018, 05:11
Re: How to fix damage weapons - by Lirbo - 08.01.2018, 12:31

Forum Jump:


Users browsing this thread: 2 Guest(s)