This will eliminate a few native calls and the last line of your code.
Untested
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < fun >
const VipFlags = ADMIN_LEVEL_H;
new iMoney_Hs;
new iMoney_Kill;
new iHp_Max;
new iHp_Hs;
new iHp_Kill;
public plugin_init( ) {
register_plugin( "PLUGIN" , "VERSION" , "AUTHOR" );
register_event( "DeathMsg" , "EventDeathMsg" , "a" , "1>0" );
iMoney_Hs = register_cvar( "amx_money_hs" , "800" );
iMoney_Kill = register_cvar( "amx_money_kill" , "500" );
iHp_Max = register_cvar( "amx_hp_max" , "100" );
iHp_Hs = register_cvar( "amx_hp_hs" , "30" );
iHp_Kill = register_cvar( "amx_hp_kill" , "15" );
}
public EventDeathMsg( ) {
new iKiller = read_data( 1 );
if( is_user_connected( iKiller ) && ( get_user_flags( iKiller ) & VipFlags ) )
{
new iMoney , iHealth , iHPMax , iHS;
iMoney = cs_get_user_money( iKiller );
iHealth = get_user_health( iKiller );
iHPMax = get_pcvar_num( iHp_Max );
iHS = read_data( 3 );
if( iMoney < 16000 )
cs_set_user_money( iKiller , clamp( iMoney + get_pcvar_num( iHS ? iMoney_Hs : iMoney_Kill ) , 0 , 16000 ) );
if( iHealth < iHPMax )
set_user_health( iKiller , clamp( iHealth + get_pcvar_num( iHS ? iHp_Hs : iHp_Kill ) , 0 , iHPMax ) );
}
}
__________________