AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Please delete this topic (https://forums.alliedmods.net/showthread.php?t=26141)

SubStream 03-27-2006 13:43

Please delete this topic
 
I am opening a new post for this subject because the information on here was out of date. Please delete this topic.

BadAim 03-27-2006 16:10

man i dont really know how but i have the same problem.
when u connect a second time it work.
i think your players dont have this problem its only the first person to connect or you because u run the server(if its a dedicated)

Hawk552 03-27-2006 16:59

You're calling too many cvars at once. The client can't send enough of them through the reliable channel.

Try calling them in batches of 3 like you did before.

BadAim 03-27-2006 17:21

i haver the same problem and i dont care i just reconect
it always work the second time

SubStream 03-27-2006 22:47

well there are 80 cvars so I can't do batches of 3... i have it split in 5 sections of 16 to go through every 5 seconds. If you can't send 16 at a time then the way I have it without arrays works better.

As for the reconnecting... if it causes anyone to not be able to play, first person or not, it is not a good way to do it. The current way it is organized without arrays has no errors and lets everyone play.

If anyone can get this to work with that many being called let me know. I appreciate your help Hawk in the idea to organize it this way. Maybe someone will come across this and figure out if it is in fact possible. As of now, the answer is no with this many cvars.

I appreciate anyone's help

BadAim 03-28-2006 20:02

anyway its what i do u can do what u want

capndurk 04-08-2006 15:50

Quote:

Originally Posted by SubStream
well there are 80 cvars so I can't do batches of 3... i have it split in 5 sections of 16 to go through every 5 seconds. If you can't send 16 at a time then the way I have it without arrays works better.

You can split it into 5 sections and still have arrays. Here's an example of the code, using 6 cvars and 3 scan functions:

Code:
#include <amxmodx> #include <amxmisc> #define numOfCvars 6        // You set this value to how many you use #define numScans   3        // Change this to 5 for your plugin new g_maxNum; new g_count = 0; new Float:gf_value; new g_cvar[numOfCvars][33]; new Float:g_value[numOfCvars]; public plugin_init() {         copy(g_cvar[0], 32, "ambient_fade");     copy(g_cvar[1], 32, "ambient_level");     copy(g_cvar[2], 32, "bottomcolor");     copy(g_cvar[3], 32, "cl_bob");     copy(g_cvar[4], 32, "cl_bobcycle");     copy(g_cvar[5], 32, "cl_bobup");     //...         g_value[0] = 100.0;     g_value[1] = 0.3;     g_value[2] = 6.0;     g_value[3] = 0.01;     g_value[4] = 0.8;     g_value[5] = 0.5;     //...         register_plugin("blah","1.0","blah");     //...         set_task(5.0, "separateScans",_,_,_,"b"); } separateScans() {     set_task(1.0, "scanPlayers1");     set_task(2.0, "scanPlayers2");     set_task(3.0, "scanPlayers3"); } scanPlayers1() {     for(new i = 1; i <= get_maxplayers(); i++)     {         if(is_user_connected(i))         {             g_count = 0;             g_maxNum = numOfCvars / numScans;       // g_maxNum = 2             while(g_count < g_maxNum)               // 0 - 1             {                 query_client_cvar(id, g_cvar[g_count], "checkCvars");                 g_count++;             }         }     } } scanPlayers2() {     for(new i = 1; i <= get_maxplayers(); i++)     {         if(is_user_connected(i))         {             g_count += g_maxNum;                    // g_count = 2             g_maxNum += g_maxNum;                   // g_maxNum = 4             while(g_count < g_maxNum)               // 2 - 3             {                 query_client_cvar(id, g_cvar[g_count], "checkCvars");                 g_count++;             }         }     } } // for the last function, you have to change < to <= scanPlayers3() {     for(new i = 1; i <= get_maxplayers(); i++)     {         if(is_user_connected(i))         {             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++;             }         }     } } // add more scanPlayers functions here public checkCvars(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; }

SubStream 04-08-2006 16:32

Quote:

Originally Posted by capndurk
Quote:

Originally Posted by SubStream
well there are 80 cvars so I can't do batches of 3... i have it split in 5 sections of 16 to go through every 5 seconds. If you can't send 16 at a time then the way I have it without arrays works better.

You can split it into 5 sections and still have arrays. Here's an example of the code, using 6 cvars and 3 scan functions:

Code:
#include <amxmodx> #include <amxmisc> #define numOfCvars 6        // You set this value to how many you use #define numScans   3        // Change this to 5 for your plugin new g_maxNum; new g_count = 0; new Float:gf_value; new g_cvar[numOfCvars][33]; new Float:g_value[numOfCvars]; public plugin_init() {         copy(g_cvar[0], 32, "ambient_fade");     copy(g_cvar[1], 32, "ambient_level");     copy(g_cvar[2], 32, "bottomcolor");     copy(g_cvar[3], 32, "cl_bob");     copy(g_cvar[4], 32, "cl_bobcycle");     copy(g_cvar[5], 32, "cl_bobup");     //...         g_value[0] = 100.0;     g_value[1] = 0.3;     g_value[2] = 6.0;     g_value[3] = 0.01;     g_value[4] = 0.8;     g_value[5] = 0.5;     //...         register_plugin("blah","1.0","blah");     //...         set_task(5.0, "separateScans",_,_,_,"b"); } separateScans() {     set_task(1.0, "scanPlayers1");     set_task(2.0, "scanPlayers2");     set_task(3.0, "scanPlayers3"); } scanPlayers1() {     for(new i = 1; i <= get_maxplayers(); i++)     {         if(is_user_connected(i))         {             g_count = 0;             g_maxNum = numOfCvars / numScans;       // g_maxNum = 2             while(g_count < g_maxNum)               // 0 - 1             {                 query_client_cvar(id, g_cvar[g_count], "checkCvars");                 g_count++;             }         }     } } scanPlayers2() {     for(new i = 1; i <= get_maxplayers(); i++)     {         if(is_user_connected(i))         {             g_count += g_maxNum;                    // g_count = 2             g_maxNum += g_maxNum;                   // g_maxNum = 4             while(g_count < g_maxNum)               // 2 - 3             {                 query_client_cvar(id, g_cvar[g_count], "checkCvars");                 g_count++;             }         }     } } // for the last function, you have to change < to <= scanPlayers3() {     for(new i = 1; i <= get_maxplayers(); i++)     {         if(is_user_connected(i))         {             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++;             }         }     } } // add more scanPlayers functions here public checkCvars(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; }

It is already split into 5 sections... that is not the problem... Let me post a large amount of code because the example in the first post on this page is only 1/5th of what the plugin actually does... since it seems nobody understands this or is working from the current plugin to see why this will not work.
Code:
#include <amxmodx> #include <amxmisc> new const gs_PLUGIN[]   = "Force CAL Open Settings" new const gs_VERSION[]  = "1.8" new const gs_AUTHOR[]   = "SubStream" new g_fcos_allow_alt_values new g_fcos_allow_hlguard_values new Float: gf_valuefromplayer new Float: gf_calfloatvalue new Float: gf_altfloatvalue new Float: gf_altfloatvalue2 new Float: gf_hlgfloatvalue new gi_players[32] new gi_playercnt new gi_playernum new gi_playerID new gi_players2[32] new gi_playercnt2 new gi_playernum2 new gi_playerID2 new gs_logname[32] new gs_logauthid[33] new gs_logip[44] public plugin_init () {     register_plugin ( gs_PLUGIN, gs_VERSION, gs_AUTHOR )     register_cvar ( "fcos_version", gs_VERSION, FCVAR_SPONLY ) // For people using HLSW     g_fcos_allow_alt_values = register_cvar ( "fcos_allow_alt_values", "1" )     g_fcos_allow_hlguard_values = register_cvar ( "fcos_allow_hlguard_values", "0" )     register_dictionary ( "fcos.txt" ) // Used for logging and admin notification         fn_servermessage () // Sends server messages on startup } public fn_servermessage () {     server_print ( "%L", LANG_SERVER, "FCOS_LANG_INFO_STARTUP", gs_PLUGIN, gs_VERSION, gs_AUTHOR )     server_print ( "%L", LANG_SERVER, "FCOS_LANG_SERVER_MSG1" ) } public client_putinserver ( id ) {     set_task ( 5.0, "fn_afterputinserver", 0, "", 0, "b" ) // Run after putinserver func and repeat } public client_disconnect ( id ) {     remove_task ( id )         return PLUGIN_HANDLED } public fn_afterputinserver () {     /* This splits up the timing of all the queries so that the server does not lag as it     would if they were all ran at the same time. */     set_task ( 1.0, "fn_query1" ) // Run fn_query1 func after 1 second     set_task ( 2.0, "fn_query2" ) // Run fn_query2 func after 2 seconds     set_task ( 3.0, "fn_query3" ) // Run fn_query3 func after 3 seconds     set_task ( 4.0, "fn_query4" ) // Run fn_query4 func after 4 seconds     set_task ( 5.0, "fn_query5" ) // Run fn_query5 func after 5 seconds } public fn_query1 () {     get_players ( gi_players, gi_playercnt, "ch" ) // Outputs players that are not bots or hltv into gi_players         for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )     {         gi_playerID = gi_players[gi_playernum]                 query_client_cvar ( gi_playerID, "ambient_fade", "fn_ambient_fade" ) // Query the cvar from the player and forwards it to function with parameters         query_client_cvar ( gi_playerID, "ambient_level", "fn_ambient_level" )         query_client_cvar ( gi_playerID, "bottomcolor", "fn_bottomcolor" )         query_client_cvar ( gi_playerID, "cl_bob", "fn_cl_bob" )         query_client_cvar ( gi_playerID, "cl_bobcycle", "fn_cl_bobcycle" )         query_client_cvar ( gi_playerID, "cl_bobup", "fn_cl_bobup" )         query_client_cvar ( gi_playerID, "cl_fixtimerate", "fn_cl_fixtimerate" )         query_client_cvar ( gi_playerID, "cl_gaitestimation", "fn_cl_gaitestimation" )         query_client_cvar ( gi_playerID, "cl_gg", "fn_cl_gg" )         query_client_cvar ( gi_playerID, "cl_resend", "fn_cl_resend" )         query_client_cvar ( gi_playerID, "cl_solid_players", "fn_cl_solid_players" )         query_client_cvar ( gi_playerID, "cl_timeout", "fn_cl_timeout" )         query_client_cvar ( gi_playerID, "cl_weather", "fn_cl_weather" )         query_client_cvar ( gi_playerID, "d_spriteskip", "fn_d_spriteskip" )         query_client_cvar ( gi_playerID, "default_fov", "fn_default_fov" )         query_client_cvar ( gi_playerID, "ex_extrapmax", "fn_ex_extrapmax" )     } } public fn_query2 () {     get_players ( gi_players, gi_playercnt, "ch" )         for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )     {         gi_playerID = gi_players[gi_playernum]                 query_client_cvar ( gi_playerID, "ex_interp", "fn_ex_interp" )         query_client_cvar ( gi_playerID, "fakelag", "fn_fakelag" )         query_client_cvar ( gi_playerID, "fakeloss", "fn_fakeloss" )         query_client_cvar ( gi_playerID, "fastsprites", "fn_fastsprites" )         query_client_cvar ( gi_playerID, "gl_affinemodels", "fn_gl_affinemodels" )         query_client_cvar ( gi_playerID, "gl_alphamin", "fn_gl_alphamin" )         query_client_cvar ( gi_playerID, "gl_clear", "fn_gl_clear" )         query_client_cvar ( gi_playerID, "gl_cull", "fn_gl_cull" )         query_client_cvar ( gi_playerID, "gl_d3dflip", "fn_gl_d3dflip" )         query_client_cvar ( gi_playerID, "gl_dither", "fn_gl_dither" )         query_client_cvar ( gi_playerID, "gl_flipmatrix", "fn_gl_flipmatrix" )         query_client_cvar ( gi_playerID, "gl_keeptjunctions", "fn_gl_keeptjunctions" )         query_client_cvar ( gi_playerID, "gl_lightholes", "fn_gl_lightholes" )         query_client_cvar ( gi_playerID, "gl_monolights", "fn_gl_monolights" )         query_client_cvar ( gi_playerID, "gl_nobind", "fn_gl_nobind" )         query_client_cvar ( gi_playerID, "gl_nocolors", "fn_gl_nocolors" )     } } public fn_query3 () {     get_players ( gi_players, gi_playercnt, "ch" )         for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )     {         gi_playerID = gi_players[gi_playernum]                 query_client_cvar ( gi_playerID, "gl_overbright", "fn_gl_overbright" )         query_client_cvar ( gi_playerID, "gl_palette_tex", "fn_gl_palette_tex" )         query_client_cvar ( gi_playerID, "gl_picmip", "fn_gl_picmip" )         query_client_cvar ( gi_playerID, "gl_playermip", "fn_gl_playermip" )         query_client_cvar ( gi_playerID, "gl_polyoffset", "fn_gl_polyoffset" )         query_client_cvar ( gi_playerID, "gl_reporttjunctions", "fn_gl_reporttjunctions" )         query_client_cvar ( gi_playerID, "gl_round_down", "fn_gl_round_down" )         query_client_cvar ( gi_playerID, "gl_spriteblend", "fn_gl_spriteblend" )         query_client_cvar ( gi_playerID, "gl_ztrick", "fn_gl_ztrick" )         query_client_cvar ( gi_playerID, "lambert", "fn_lambert" )         query_client_cvar ( gi_playerID, "lightgamma", "fn_lightgamma" )         query_client_cvar ( gi_playerID, "max_smokepuffs", "fn_max_smokepuffs" )         query_client_cvar ( gi_playerID, "nosound", "fn_nosound" )         query_client_cvar ( gi_playerID, "r_bmodelhighfrac", "fn_r_bmodelhighfrac" )         query_client_cvar ( gi_playerID, "r_bmodelinterp", "fn_r_bmodelinterp" )         query_client_cvar ( gi_playerID, "r_cachestudio", "fn_r_cachestudio" )     } } public fn_query4 () {     get_players ( gi_players, gi_playercnt, "ch" )         for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )     {         gi_playerID = gi_players[gi_playernum]                 query_client_cvar ( gi_playerID, "r_cullsequencebox", "fn_r_cullsequencebox" )         query_client_cvar ( gi_playerID, "r_detailtextures", "fn_r_detailtextures" )         query_client_cvar ( gi_playerID, "r_drawentities", "fn_r_drawentities" )         query_client_cvar ( gi_playerID, "r_drawviewmodel", "fn_r_drawviewmodel" )         query_client_cvar ( gi_playerID, "r_dynamic", "fn_r_dynamic" )         query_client_cvar ( gi_playerID, "r_fullbright", "fn_r_fullbright" )         query_client_cvar ( gi_playerID, "r_glowshellfreq", "fn_r_glowshellfreq" )         query_client_cvar ( gi_playerID, "r_lightmap", "fn_r_lightmap" )         query_client_cvar ( gi_playerID, "r_mirroralpha", "fn_r_mirroralpha" )         query_client_cvar ( gi_playerID, "r_norefresh", "fn_r_norefresh" )         query_client_cvar ( gi_playerID, "r_novis", "fn_r_novis" )         query_client_cvar ( gi_playerID, "r_speeds", "fn_r_speeds" )         query_client_cvar ( gi_playerID, "r_traceglow", "fn_r_traceglow" )         query_client_cvar ( gi_playerID, "r_wadtextures", "fn_r_wadtextures" )         query_client_cvar ( gi_playerID, "r_wateralpha", "fn_r_wateralpha" )         query_client_cvar ( gi_playerID, "s_a3d", "fn_s_a3d" )     } } public fn_query5 () {     get_players ( gi_players, gi_playercnt, "ch" )         for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )     {         gi_playerID = gi_players[gi_playernum]                 query_client_cvar ( gi_playerID, "s_automax_distance", "fn_s_automax_distance" )         query_client_cvar ( gi_playerID, "s_automin_distance", "fn_s_automin_distance" )         query_client_cvar ( gi_playerID, "s_eax", "fn_s_eax" )         query_client_cvar ( gi_playerID, "s_max_distance", "fn_s_max_distance" )         query_client_cvar ( gi_playerID, "s_occfactor", "fn_s_occfactor" )         query_client_cvar ( gi_playerID, "s_polykeep", "fn_s_polykeep" )         query_client_cvar ( gi_playerID, "s_polysize", "fn_s_polysize" )         query_client_cvar ( gi_playerID, "s_rolloff", "fn_s_rolloff" )         query_client_cvar ( gi_playerID, "texgamma", "fn_texgamma" )         query_client_cvar ( gi_playerID, "topcolor", "fn_topcolor" )         query_client_cvar ( gi_playerID, "developer", "fn_developer" )                 if ( get_pcvar_num ( g_fcos_allow_alt_values ) && get_pcvar_num ( g_fcos_allow_hlguard_values ) ) // If g_fcos_allow_alt_values and g_fcos_allow_hlguard_values = 1         {             query_client_cvar ( gi_playerID, "gl_max_size", "fn_gl_max_size" )             query_client_cvar ( gi_playerID, "gl_wateramp", "fn_gl_wateramp" )             query_client_cvar ( gi_playerID, "gl_zmax", "fn_gl_zmax_avhlg" )             query_client_cvar ( gi_playerID, "r_decals", "fn_r_decals" )             query_client_cvar ( gi_playerID, "s_min_distance", "fn_s_min_distance" )         }                 else if ( ! get_pcvar_num ( g_fcos_allow_alt_values ) && get_pcvar_num ( g_fcos_allow_hlguard_values ) ) // If g_fcos_allow_hlguard_values = 1         {             query_client_cvar ( gi_playerID, "gl_max_size", "fn_gl_max_size_sv" )             query_client_cvar ( gi_playerID, "gl_wateramp", "fn_gl_wateramp_sv" )             query_client_cvar ( gi_playerID, "gl_zmax", "fn_gl_zmax_hlg" )             query_client_cvar ( gi_playerID, "r_decals", "fn_r_decals_sv" )             query_client_cvar ( gi_playerID, "s_min_distance", "fn_s_min_distance" )         }                 else if ( get_pcvar_num ( g_fcos_allow_alt_values ) && ! get_pcvar_num ( g_fcos_allow_hlguard_values ) ) // If g_fcos_allow_alt_values = 1         {             query_client_cvar ( gi_playerID, "gl_max_size", "fn_gl_max_size" )             query_client_cvar ( gi_playerID, "gl_wateramp", "fn_gl_wateramp" )             query_client_cvar ( gi_playerID, "gl_zmax", "fn_gl_zmax" )             query_client_cvar ( gi_playerID, "r_decals", "fn_r_decals" )             query_client_cvar ( gi_playerID, "s_min_distance", "fn_s_min_distance" )         }                 else if ( ! get_pcvar_num ( g_fcos_allow_alt_values ) && ! get_pcvar_num ( g_fcos_allow_hlguard_values ) ) // If g_fcos_allow_alt_values and g_fcos_allow_hlguard_values = 0         {             query_client_cvar ( gi_playerID, "gl_max_size", "fn_gl_max_size_sv" )             query_client_cvar ( gi_playerID, "gl_wateramp", "fn_gl_wateramp_sv" )             query_client_cvar ( gi_playerID, "gl_zmax", "fn_gl_zmax_sv" )             query_client_cvar ( gi_playerID, "r_decals", "fn_r_decals_sv" )             query_client_cvar ( gi_playerID, "s_min_distance", "fn_s_min_distance_sv" )         }                 else         {             return PLUGIN_CONTINUE         }     }         return PLUGIN_CONTINUE }
And now to save space... I will only post the result function of one of these query_client_cvar instances
Code:
public  fn_cl_weather ( gi_playerID, const s_cvarname[], const value[] ) {     gf_valuefromplayer = floatstr ( value )     gf_calfloatvalue = 1.0         if ( ! ( gf_valuefromplayer == gf_calfloatvalue ) )     {         client_cmd ( gi_playerID, "%s %f", s_cvarname, gf_calfloatvalue )                 get_user_name ( gi_playerID, gs_logname, 31 )         get_user_authid ( gi_playerID, gs_logauthid, 32 )         get_user_ip ( gi_playerID, gs_logip, 43 )                 log_amx ( "%L", LANG_SERVER, "FCOS_LANG_LOG_ENTRY", gs_logname, get_user_userid ( gi_playerID ), gs_logauthid, gs_logip, s_cvarname, gf_valuefromplayer, gf_calfloatvalue )                 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 ) ) )             {                 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 )             }         }     }         else     {         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED }
As you can see, I already have them split up into 5 groups. The problem is not splitting up the query_client_cvar the problem is that when you combine all 16 query_client_cvars just within fn_query1 the result function, as shown in the first post, gets reliable channel overflow. If I were to create result functions that only handled 3 query_client_cvars I would still have 6 query_client_cvar instances for every fn_query function resulting in a total of 30 query_client_cvars and 30 result functions and 30 Arrays of cvars, 30 arrays of cal values, and plus the individual result functions for hlguard and alt value dynamic result functions.

I hope this has cleared up the problem.

capndurk 04-08-2006 16:37

I still don't understand. If the problem is assigning 16 query_client_cvars to one function, then just make more functions.. like 5 different cvar functions:

Code:
public checkCvars1(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars2(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars3(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars4(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars5(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; }

And create more if necessary.

SubStream 04-08-2006 16:51

Quote:

Originally Posted by capndurk
I still don't understand. If the problem is assigning 16 query_client_cvars to one function, then just make more functions.. like 5 different cvar functions:

Code:
public checkCvars1(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars2(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars3(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars4(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; } public checkCvars5(id, const cvar[], const value[]) {     gf_value = str_to_float(value);     if(gf_value != g_value[g_count])     {         client_cmd(id, "%s %f", cvar, gf_value);     }         return PLUGIN_HANDLED; }

And create more if necessary.

There are already 5... fn_query1, fn_query2, fn_query3, fn_query4, and fn_query5. If you split them up anymore then you won't be able to check them within every 5 seconds. The goal is to check 16 per second which will result in all 80 checked every 5 seconds. If you can't check all 80 in 5 seconds using arrays then there is no point in using arrays. The point of the plugin is to keep them from changing them back. If the values are only enforced every 30 seconds (or however long it would take to cycle through all 80) that would be a pretty weak useless plugin. That means that for 30 seconds (or however long) someone could have gl_polyoffset set to 999999 which allows some wall hacks to work. 30 seconds or anywhere close to that would be unacceptable and make the plugin useless because its goal of strictly enforcing CAL settings would not be accomplished.


All times are GMT -4. The time now is 16:44.

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