AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   is possible get Renderer mod of client? (https://forums.alliedmods.net/showthread.php?t=83326)

padilha007 01-07-2009 19:49

is possible get Renderer mod of client?
 
i need get if is:

OpenGL
software


possible? if not i have one problem...

i use rendering to make one player invisible, if the user is on software him see the invisisble player

MPNumB 01-07-2009 22:15

Re: is possible get Renderer mod of client?
 
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 ")); 


danielkza 01-07-2009 22:35

Re: is possible get Renderer mod of client?
 
Quote:

Originally Posted by MPNumB (Post 740190)
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.

MPNumB 01-07-2009 22:40

Re: is possible get Renderer mod of client?
 
I know it doesnt... I was saying that for example:

If client used cmd:

alias r_drawviewmodel".

than after making cvar check it will return "Bad CVAR request".

danielkza 01-07-2009 22:50

Re: is possible get Renderer mod of client?
 
Quote:

Originally Posted by MPNumB (Post 740199)
I know it doesnt... I was saying that for example:

If client used cmd:

alias r_drawviewmodel".

than after making cvar check it will return "Bad CVAR request".

It won't, just tested, and this prints the correct cvar value of 300 (what it was before I typed /decals)
PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_clcmd("say /decals""cmdDecals")
}

public 
cmdDecals(id)
{
    
client_cmd(id"alias r_decals randomshit")
    
query_client_cvar(id"r_decals""CVarCheck_Handler")
}

public 
CVarCheck_Handler(idszCvar[], szValue[])
{
    
client_print(idprint_chat"%s = %s"szCvarszValue)



padilha007 01-07-2009 23:37

Re: is possible get Renderer mod of client?
 
a code sets the other?

tnx in advance

danielkza 01-07-2009 23:38

Re: is possible get Renderer mod of client?
 
Quote:

Originally Posted by padilha007 (Post 740213)
a code sets the other?

tnx in advance

Didn't get what you mean. What code, and what other code?

padilha007 01-08-2009 01:48

Re: is possible get Renderer mod of client?
 
i get both?

padilha007 01-08-2009 22:30

Re: is possible get Renderer mod of client?
 
dont work your code MPNumB

padilha007 01-29-2009 17:17

Re: is possible get Renderer mod of client?
 
bump


All times are GMT -4. The time now is 09:14.

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