Es queryclientvar

From EventScripts Community Encyclopedia


Overview

Syntax: es_queryclientvar <userid> <varname>

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: {{{x}}}

Description

Submits a query to the userid for the value of the console variable specified. It will return the result of the query in the event es_player_variable.

Parameters

  • userid - userid of the user whose variable you want to query
  • varname - name of the network-related client-side variable you'd like to query


Examples

event player_activate
{
  	es_queryclientvar event_var(userid) rate
  	es_queryclientvar event_var(userid) cl_updaterate
  	es_queryclientvar event_var(userid) cl_cmdrate
}
 
event es_player_variable
{
  if (event_var(status) == "success") do
  {
    	if (event_var(variable) == "rate") do
    	{
     		if (event_var(value) < 5000) then kickid event_var(userid)
    	}
    	if (event_var(variable) in "cl_updaterate cl_cmdrate") do
    	{
     		if (event_var(value) < 100) then kickid event_var(userid)
    	}
  }
  else echo Variable query for event_var(variable) not successful. Status of the var: event_var(status)
}


Notes

  • Can obtain much more than just network variables from the client. For example: cl_restrict_server_commands mat_picmip mat_dxlevel
  • Quite similar to es_getclientvar, but Valve has introduced a new method for querying client variables which is used by this command.
  • These variables are likely only available at player_activate and later.
  • The most common use for es_queryclientvar is to detect bad rate values for players.
  • You cannot read binds for a player.
  • This command is almost useless for catching cheat programs.
  • Status you can get by the event_var(status) are: success, not found, not variable, protected


See also


External links

es_xqueryclientvar


{{{category}}}

blog comments powered by Disqus