Hey! Could someone tell me how to block a function with cvar?
I have this code, that blocks players from getting grenades in certain maps and I want to block that if
PHP Code:
g_map_active = register_cvar("map_active", "1")
is set to 0.
I believe it should be something with this:
PHP Code:
if (!get_pcvar_num(map_active))
return PLUGIN_CONTINUE
But I can't figure it out were to put it.
PHP Code:
public fwHamPlayerSpawnPost(id)
{
VIPMenuUsed=0;
get_mapname( szMap , charsmax( szMap ) );
for( new i = 0 ; i < sizeof( mapnames ) ; i++ )
{
if ( containi( szMap , mapnames[ i ] ) !=-1 )
return;
}
if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H)
{
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
give_item(id, "item_assaultsuit");
give_item(id, "item_thighpack");
}
}