Thread: [Solved] No Fall Demage Code Problem!
View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-26-2020 , 21:23   Re: No Fall Demage Code Problem!
Reply With Quote #2

When fall damage occurs, attacker is worldspawn so the code is stopping here, since worldspawn is not connected.

if (!is_valid_ent(victim) || !g_isAlive[victim] || !is_user_connected(attacker))
return HAM_IGNORED

Try this:
PHP Code:
public ham_TakeDamagevictim inflictor attacker Float:damage damagebits )
{
    if ( 
damagebits DMG_FALL )
    {
        return 
HAM_SUPERCEDE;
    }
    
    if ( !
pev_validvictim ) || !is_user_alivevictim ) || !is_user_connectedattacker ) )
        return 
HAM_IGNORED
    
    
if ( g_boolCanBuild || g_boolRoundEnded || g_boolPrepTime || ( victim == attacker ) )
        return 
HAM_SUPERCEDE;
    
    if ( 
g_iSupercut )
    {
        
SetHamParamFloatdamage 99.0 );
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;

__________________

Last edited by Bugsy; 07-26-2020 at 21:24.
Bugsy is offline