Raised This Month: $ Target: $400
 0% 

How to make sure a variable is not unset


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Cd5ssmffan
BANNED
Join Date: Feb 2017
Location: GB
Old 06-18-2018 , 16:25   How to make sure a variable is not unset
Reply With Quote #1

Code:
g_blah = register_cvar("amx_blah","")

...

if (g_blah == "") {
//cvar is empty
}
else
{
//cvar has been set
}
How do you check if g_blah is actually unset here in a config? I've tried this method but I am getting error 033: array must be indexed <variable "-unknown-">

Last edited by Cd5ssmffan; 06-18-2018 at 16:26.
Cd5ssmffan is offline
Send a message via ICQ to Cd5ssmffan Send a message via AIM to Cd5ssmffan Send a message via Yahoo to Cd5ssmffan Send a message via Skype™ to Cd5ssmffan
 


Thread Tools
Display Modes

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 12:25.


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