My problem is when i hit a player, my game crash it and I discovered that the problem comes from these two forwards:
PHP Code:
public ham_TakeDamage_Pre( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
{
if ( !is_user_alive( iAttacker ) )
return HAM_IGNORED;
static Float:flPlayerDmgPower;
flPlayerDmgPower = flDamage * g_flDamagePower[ iAttacker ];
if ( get_user_weapon( iAttacker ) == CSW_KNIFE )
SetHamParamFloat( 4, g_bPlayerIsZombie[ iAttacker ] ? random_float( 4.0, 8.0 ) : 2.0 * flPlayerDmgPower );
if ( !g_bPlayerIsZombie[ iAttacker ] && iBits & ( 1 << 24 ) )
{
if( iAttacker == iVictim ) return HAM_IGNORED;
SetHamParamFloat( 4, 3.0 * flPlayerDmgPower );
return HAM_HANDLED;
}
if ( !g_bPlayerIsZombie[ iAttacker ] )
SetHamParamFloat( 4, flPlayerDmgPower );
return HAM_IGNORED;
}
PHP Code:
public ham_TakeDamage_Post( iVictim, iInflictor, iAttacker, Float:flDamage, iBits )
{
if ( !is_user_alive( iAttacker ) )
return HAM_IGNORED;
if ( g_bPlayerIsZombie[ iVictim ] )
set_pdata_float( iVictim, 108, 0.9 );
else
set_pdata_float( iVictim, 108, 1.0 );
return HAM_IGNORED;
}
Something I doing wrong in those codes? I don't get it.
__________________