Raised This Month: $ Target: $400
 0% 

[DONE]Blocking a function with cvar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-08-2013 , 12:04   [DONE]Blocking a function with cvar
Reply With Quote #1

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_mapnameszMap charsmaxszMap ) );
    for( new 
sizeofmapnames ) ; i++ )
    {
        if ( 
containiszMap mapnames] ) !=-)
            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");
    }


Last edited by Unkolix; 02-09-2013 at 12:07.
Unkolix is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode