Raised This Month: $ Target: $400
 0% 

is possible get Renderer mod of client?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-07-2009 , 22:35   Re: is possible get Renderer mod of client?
Reply With Quote #3

Quote:
Originally Posted by MPNumB View Post
Possible, but not 100% currect (client can just alias the cvar and...). Here is my example:

PHP Code:
#include <amxmodx>
 
#define PLUGIN_NAME    "Get My 3D Settings"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR  "Numb"
 
#define OPENGL_CVAR "gl_clear" // NOTE: if used aliased selected cvar, data will be stored as if user is not using OpenGL
 
new bool:g_bIsUserOpenGL[33];
 
public 
plugin_init()
{
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
 
 
register_clcmd("say /opengl""clcmd_opengl");
}
 
public 
client_connect(iPlrId)
{
 
g_bIsUserOpenGL[iPlrId] = false;
 
 if( !
is_user_bot(iPlrId) && !is_user_hltv(iPlrId) )
  
query_client_cvar(iPlrIdOPENGL_CVAR"cvar_result_func");
}
 
public 
cvar_result_func(iPlrId, const iCvar[], const iValue[])
 
g_bIsUserOpenGL[iPlrId] = (equal(iValue"Bad CVAR request")?false:true);
 
public 
clcmd_opengl(iPlrId)
 
client_print(iPlrIdprint_chat"* You are %susing OpenGL 3D setting", (g_bIsUserOpenGL[iPlrId]?"":"NOT ")); 
query_client_cvar does not take any aliases into account. The cvar check is guaranteed to work ,what's not is setting it through client_cmd.
__________________

Community / No support through PM
danielkza is offline
 



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 09:14.


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