View Single Post
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 22:08  
Reply With Quote #22

Quote:
Originally Posted by SubStream
If there is a way to read the CAL values from the array then please show me. Taking out the for loop did not fix the problem.
Calm down dude, damn... I'm trying to help you, so when something doesn't work automatically you don't have to blow up in my face. You had a problem in your code, and obviously you had another problem as well, because taking out the for loop didn't cause any problems that weren't already there. Now, humor me for a second and change a few things around...

1) change that for loop inside fn_query1() to this:

Code:
while ( gi_cvarnum < SIZE ) {     query_client_cvar ( gi_playerID, gi_cvar1[gi_cvarnum], "fn_queryresult1" ) // Query the cvar from the player and forwards it to function with parameters     gi_cvarnum++ }

I just don't feel comfortable with gi_cvarnum being changed in a for loop, because it seems as though it has its own scope. I don't know if that's true, but it's better to use a while loop and eliminate any suspicions than use a for loop and have them.

2) In fn_queryresult1, take out this:

Code:
else {     return PLUGIN_HANDLED }

It's not needed, since you have another return PLUGIN_HANDLED right under it.

3) For the last time... change this:

Code:
if ( ! ( is_user_admin ( gi_playerID2 ) ) ) // If user is not admin {     return PLUGIN_HANDLED }             else {     client_print ( gi_playerID2, print_console, "%L", LANG_SERVER, "FCOS_LANG_SHOW_ADMIN", gs_logname, s_cvarname, gf_valuefromplayer, gf_calfloatvalue ) // Displays FCOS_LANG_SHOW_ADMIN in console to admin only }

to this:

Code:
if ( is_user_admin ( gi_playerID2 ) ) // If user is admin {     client_print ( gi_playerID2, print_console, "%L", LANG_SERVER, "FCOS_LANG_SHOW_ADMIN", gs_logname, s_cvarname, gf_valuefromplayer, gf_calfloatvalue ) // Displays FCOS_LANG_SHOW_ADMIN in console to admin only }


And for the record, your variable names are far too long; Hungarian Notation may be important, but KISS is more important if you want to have maximum readability.
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline