Raised This Month: $ Target: $400
 0% 

register_cvar() and get_pcvar_num()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hypheni
Senior Member
Join Date: Jul 2011
Location: India
Old 01-13-2013 , 02:24   Re: register_cvar() and get_pcvar_num()
Reply With Quote #7

Actually that was originally written and not working. Let me show you the original code.

PHP Code:
new amx_showads
new g_ads

public plugin_init() 
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
amx_showads register_cvar("amx_showads""1")
}

public 
plugin_precache()
{
    
g_ads ArrayCreate(128)
}

public 
plugin_cfg()
{
    
load_ini("Ad_File.ini"g_ads)

    if(
get_pcvar_num(amx_showads) == && ArraySize(g_ads) != 0)
    {
        
server_cmd("echo ----Ads ON")
        
set_task(DELAY_ADS"ShowAds"0""0"b")
    }
    else
    {
        
server_cmd("echo Ads OFF")
    } 
Now with this amx_showads is set to 0 in amxx.cfg but while the server is booting as you mentioned already it prints ----Ads ON while it should print ----Ads OFF
hypheni is offline
Send a message via Skype™ to hypheni
 



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 13:37.


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