PHP Code:
#include < amxmodx >
#include < fun >
#include < hamsandwich >
#define ADMINS_ONLY
#define ADMIN_LEVEL ADMIN_LEVEL_A
new const Version[ ] = "1.3"
new cvar, hp
public plugin_init( )
{
register_plugin("Premium health pack", Version, "om");
RegisterHam( Ham_Spawn, "player", "HamPlayerSpawnPost", 1 );
cvar = register_cvar( "hp_enable", "1" );
hp = register_cvar( "hp_extra", "25" );
}
public HamPlayerSpawnPost( id )
{
if( get_pcvar_num( cvar ) )
{
if( is_user_alive( id ) ) {
#if defined ADMINS_ONLY
if ( !(get_user_flags( id ) & ADMIN_LEVEL ) )
return PLUGIN_HANDLED;
#endif
set_user_health( id, get_user_health( id ) + get_pcvar_num( hp ) );
}
}
return PLUGIN_CONTINUE;
}