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_NAME, PLUGIN_VERSION, PLUGIN_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(iPlrId, OPENGL_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(iPlrId, print_chat, "* You are %susing OpenGL 3D setting", (g_bIsUserOpenGL[iPlrId]?"":"NOT "));
__________________