Raised This Month: $51 Target: $400
 12% 

Please delete this topic


Post New Thread Reply   
 
Thread Tools Display Modes
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 16:59  
Reply With Quote #11

Why did you jump from 5 to 30 seconds? Just use 8 or 10 seconds to check all 80... like 8 seconds, and 10 for each function. Or 10 and 8 for each function.


Also, stop quoting my posts, because it makes the posts too long.
__________________
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
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 17:25  
Reply With Quote #12

If you click the Post Reply button and scroll all the way down, it has what everyone's posted on that particular page.

And that's too bad that it doesn't work... > 100 KB for a plugin size is quite large, and it's too bad there's not some way to shorten it.

//edit// err... sorry for double posting... why did you delete your post?
__________________
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
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-08-2006 , 18:17  
Reply With Quote #13

I erased the post because I have fixed the reliable channel overflow problem and now found another problem even when arrays don't cause reliable channel overflow.
SubStream is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 18:23  
Reply With Quote #14

Quote:
Originally Posted by SubStream
I erased the post because I have fixed the reliable channel overflow problem and now found another problem even when arrays don't cause reliable channel overflow.
how did you fix it? and... what's the other problem?
__________________
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
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-08-2006 , 18:28  
Reply With Quote #15

I am not sure I started from scratch and the reliable channel over flow problem is gone... now I have another problem... read the first post.
SubStream is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 18:54  
Reply With Quote #16

This is the problem, in the fn_queryresult1 function:

Code:
for ( gi_cvarnum = 0; gi_cvarnum < SIZE; gi_cvarnum++ ) {     gf_calfloatvalue = floatstr ( gf_calvalues1[gi_cvarnum] )             if ( ! ( gf_valuefromplayer == gf_calfloatvalue ) ) // If not = to CAL Open required value     {         client_cmd ( gi_playerID, "%s %f", gi_cvar1[gi_cvarnum], gf_calfloatvalue ) // Executes command on player                     get_user_name ( gi_playerID, gs_logname, 31 ) // Outputs the user's name into gs_logname         get_user_authid ( gi_playerID, gs_logauthid, 32 ) //  Outputs the user's authid into gs_logauthid         get_user_ip ( gi_playerID, gs_logip, 43 ) // Outputs the user's IP into gs_logip                     log_amx ( "%L", LANG_SERVER, "FCOS_LANG_LOG_ENTRY", gs_logname, get_user_userid ( gi_playerID ), gs_logauthid, gs_logip, gi_cvar1[gi_cvarnum], gf_valuefromplayer, gf_calfloatvalue ) // Logs FCOS_LANG_LOG_ENTRY                     get_players ( gi_players2, gi_playercnt2, "ch" )                 for ( gi_playernum2 = 0; gi_playernum2 < gi_playercnt2; gi_playernum2++ )         {             gi_playerID2 = gi_players2[gi_playernum2]                         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, gi_cvar1[gi_cvarnum], gf_valuefromplayer, gf_calfloatvalue ) // Displays FCOS_LANG_SHOW_ADMIN in console to admin only             }         }     }             else     {         return PLUGIN_HANDLED     }             return PLUGIN_HANDLED }

Every time you call this function:

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

You're checking every cvar in that array for the size of the array number of times (SIZE). In other words, you're checking each cvar in the query_client_cvar function, instead of just one cvar, which is what I intended you to do in my original code.


The reason you get that message over and over again on ambient_fade is because you return PLUGIN_HANDLED in the if(is_user_admin) statement, as opposed to just continue.
__________________
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
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-08-2006 , 19:02  
Reply With Quote #17

It is hard to read your code that you wrote and apply it to mine when you create all new variable names... on top of that you define each slot of the multidimensional array one at a time when I do it in a neater way... so reading from yours and then applying it to mine is difficult for me... I have to go through and look back from yours to mine to see which of your variables represent the same thing as mine. It would be easier to use the information you posted if you took what I already have and just changed what needed to be changed... but I am sure I can figure it out anyhow. I will try switch it to return plugin_handled and try using the code you posted on the first page to understand how to fix the problem. I'll post back later as to whether it worked or not and to update the code on the front page.

edit:

sorry but you have to explain this
Code:
g_count += g_maxNum;                    // g_count = 4             g_maxNum += g_maxNum;                    // g_maxNum = 6                         while ( g_count <= g_maxNum )                // 4 - 6             {                 query_client_cvar ( id, g_cvar[g_count], "checkCvars" );                 g_count++;             }
Why do you use g_maxnum instead of numOfCvars which is defined above as 6? and why do you add max num to max num? and why do you add max num to count??
SubStream is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 19:26  
Reply With Quote #18

Quote:
Originally Posted by SubStream
It is hard to read your code that you wrote and apply it to mine when you create all new variable names... I have to go through and look back from yours to mine to see which of your variables are the same as mine. I will try switch it to return plugin_handled and try using the code you posted on the first page to understand how to fix the problem. I'll post back later as to whether it worked or not and to update the code on the front page.
I know, your code is hard to read too

-------------------------

Anyway, you also have to fix the other thing..

Here is the logic of your program the way it is now, with code snippets put in:

Step 1:

Code:
for ( gi_cvarnum = 0; gi_cvarnum < SIZE; gi_cvarnum++ ) {     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 = 0
call query_client_cvar(id, gi_cvar1[0], "fn_queryresult1")

Step 2:

Code:
public fn_queryresult1 ( gi_playerID, const s_cvarname[], const value[] ) {     gf_valuefromplayer = floatstr ( value )         for ( gi_cvarnum = 0; gi_cvarnum < SIZE; gi_cvarnum++ )     {         gf_calfloatvalue = floatstr ( gf_calvalues1[gi_cvarnum] )      //....

store gf_valuefromplayer
gi_cvarnum = 0
gf_calfloatvalue = floatstr ( ambient_fade)

-------------------------

The problem with this is that you are trying to go through every single cvar in the array in your fn_queryresult1 function, and you should only go through one at a time. This is why you are getting Reliable channel overflow, because you're not just calling however many cvars are in the array, you're calling each one SIZE number of times.

In other words, instead of running the checker n times, you're running it n * n times! ;)
__________________
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
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 04-08-2006 , 19:33  
Reply With Quote #19

First: My code is way easier to read... I use hungarian notation and list the multidimensional array is a neater way.

Second: OK... I need to go through one at a time... I understand that... and I would do that how?

Doesn't
Code:
for ( gi_cvarnum = 0; gi_cvarnum < SIZE; gi_cvarnum++ )     {         gf_calfloatvalue = floatstr ( gf_calvalues1[gi_cvarnum] )
loop through gi_cvarnum from 0 through 15 hence looping through gf_calvalues1[0] gf_calvalues1[1] gf_calvalues1[2] etc. for every value < SIZE? isn't that going through one at a time??? I believe so. Then after gf_calvalues1[0] gi_cvarnum++ adds one to make cvarnum = 1 which then makes gf_calfloat value = floatstr ( gf_calvalues1[1] )... hence.. going through them one at a time as well... isn't that the same thing??? you just use the while loop... whats the difference??? Looping is looping isn't it? Please explain why your way is different. For and while are basically the same thing just written differently.

Another thing... how am I calling anything "SIZE number of times" as you put it??? Apparently from the log I am not calling cl_weather ANY number of times... and I'm definetly not calling ambient_fade SIZE (16) number of times otherwise the value found in the log file would be the same each time but if you look on the log file ... the value it changes from each time is = to the value found from each individual CVAR in the array...example[code]L 04/08/2006 - 16:59:48: [fcos.amxx] "Player<7><STEAM_0:1:1234567><>" address "0.0.0.0:27015" changed "ambient_fade" from illegal value "35.000000" to CAL required value "100.000000".
L 04/08/2006 - 16:59:48: [fcos.amxx] "Player<7><STEAM_0:1:1234567><>" address "0.0.0.0:27015" changed "ambient_fade" from illegal value "0.000000" to CAL required value "100.000000".[code] This is NOT ambient_fade getting called 16 times... this is cl_timeout and cl_weather values ... 35 is the cl_timeout value I had and I set cl_weather to 0 to see if it was working properly (cal req. value is 1). The reason it says ambient_fade is not because it is being called SIZE number of times.. it is because when logging/showing in console, gi_cvar1[gi_cvarnum] represents the cvar name and for some reason it is only reading the first CVAR. I will go change gi_cvar1[gi_cvarnum] to s_cvarname and repost a new log to demonstrate what I am talking about.
SubStream is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 04-08-2006 , 20:11  
Reply With Quote #20

Just remove the for loop inside

Code:
public fn_queryresult1 ( gi_playerID, const s_cvarname[], const value[] )

That way, instead of this:
Code:
--- gi_cvarnum = 0 ---
- "ambient_fade"
- "ambient_level"
- "bottomcolor"
- "cl_bob"
- "cl_bobcycle"
- "cl_bobup"
- "cl_fixtimerate"
- "cl_gaitestimation"
- "cl_gg"
- "cl_resend"
- "cl_solid_players"
- "cl_timeout"
- "cl_weather"
- "d_spriteskip"
- "default_fov"
- "ex_extrapmax"
--- gi_cvarnum = 1 ---
- "ambient_fade"
- "ambient_level"
- "bottomcolor"
- "cl_bob"
- "cl_bobcycle"
- "cl_bobup"
- "cl_fixtimerate"
- "cl_gaitestimation"
- "cl_gg"
- "cl_resend"
- "cl_solid_players"
- "cl_timeout"
- "cl_weather"
- "d_spriteskip"
- "default_fov"
- "ex_extrapmax"
--- etc. ---
it will be (this is the way it's supposed to be):

Code:
--- gi_cvarnum = 0 ---
- "ambient_fade"
--- gi_cvarnum = 1 ---
- "ambient_level"
--- gi_cvarnum = 2 ---
- "bottomcolor"
--- gi_cvarnum = 3 ---
- "cl_bob"
--- gi_cvarnum = 4 ---
- "cl_bobcycle"
--- etc. ---
I'll discuss more after dinner ;)
__________________
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
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 22:03.


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