Raised This Month: $ Target: $400
 0% 

Cvars won't register, getting "error 017: undefined symbol" on compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TwN
Junior Member
Join Date: Apr 2008
Location: Netherlands
Old 05-01-2008 , 08:22   Cvars won't register, getting "error 017: undefined symbol" on compile
Reply With Quote #1

This is part of my first plugin, OverKill, OK in short. The cvars, kinda overkilled the amount of cvars, won't register, or atleast, I can't get their values with get_cvar_num/float/whatever.

Error on compilation (webcompiler):
/home/groups/amxmodx/tmp3/phpcZV5XX.sma(68 ) : error 017: undefined symbol "amx_ok_reward_cap"

This happends on several other occasions, but I think they are all on the same cause. I changed the plugin size (#pragma), had a dumb thought that all those cvars needed more memory, wasn't the case.
Code might look messy, as I tried hard to fix it, I really tried everything I know.

PHP Code:
public plugin_init(){ 
    
register_plugin(NAME,VERSION,AUTHOR)
    
register_cvar("amx_overkill","1")
    
register_cvar("amx_ok_perc","100")
    
register_cvar("amx_ok_life_cap","0")
    
register_cvar("amx_ok_max","125")
    
register_cvar("amx_ok_reward_cap","25")
    
register_cvar("amx_ok_perc_capped","33")
    
register_cvar("amx_ok_ff","1")
    
register_event("DeathMsg","overkill","ade","5=0")
    
register_event("ResetHUD","load_health","be"
    
register_logevent("save_health",2,"1=Round_End"
    return 
PLUGIN_CONTINUE
}
//..//
//line 68//
    
new reward_cap get_cvar_num(amx_ok_reward_cap
(uploaded sma aswell)

Last edited by TwN; 02-07-2009 at 12:03.
TwN is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-01-2008 , 08:46   Re: Cvars won't register, getting "error 017: undefined symbol" on compile
Reply With Quote #2

Code:
new amx_ok_reward_cap public plugin_init(){     register_plugin(NAME,VERSION,AUTHOR)     register_cvar("amx_overkill","1")     register_cvar("amx_ok_perc","100")     register_cvar("amx_ok_life_cap","0")     register_cvar("amx_ok_max","125")     amx_ok_reward_cap = register_cvar("amx_ok_reward_cap","25")     register_cvar("amx_ok_perc_capped","33")     register_cvar("amx_ok_ff","1")     register_event("DeathMsg","overkill","ade","5=0")     register_event("ResetHUD","load_health","be")     register_logevent("save_health",2,"1=Round_End")     return PLUGIN_CONTINUE } //..// //line 68//     new reward_cap = get_pcvar_num(amx_ok_reward_cap)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
TwN
Junior Member
Join Date: Apr 2008
Location: Netherlands
Old 05-01-2008 , 10:16   Re: Cvars won't register, getting "error 017: undefined symbol" on compile
Reply With Quote #3

Thanks it works, but why should I create pcvars (private ??) and should I do it for all that work w/o changing?
And why doesn't the normal way work? And is there any way to break out of a loop, (other then setting a var and waiting for the loop to finish)

Last edited by TwN; 05-01-2008 at 10:21. Reason: added question
TwN is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-01-2008 , 10:23   Re: Cvars won't register, getting "error 017: undefined symbol" on compile
Reply With Quote #4

You should use pcvars because it is better and faster. If you use *et_cvar_*, it has to search through all cvars until it finds the one it is looking for
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
TwN
Junior Member
Join Date: Apr 2008
Location: Netherlands
Old 05-01-2008 , 10:32   Re: Cvars won't register, getting "error 017: undefined symbol" on compile
Reply With Quote #5

But why doesn't the "normal" way work
TwN is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-01-2008 , 10:48   Re: Cvars won't register, getting "error 017: undefined symbol" on compile
Reply With Quote #6

The old way works fine, it is you who has made the typo. The cvar name is a STRING, not a variable. So, using get_cvar_num(amx_ok_reward_cap) is incorrect. It has to be get_cvar_num("amx_ok_reward_cap")
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply



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:04.


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