Es getclientvar

From EventScripts Community Encyclopedia

Overview

Syntax: es_getclientvar <server-variable> <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: es_xgetclientvar

Description

Obtains a network-related console variable for the particular userid and stores it in server-variable.

Parameters

  • server-variable - server-side variable where you want to store the value of the client-side variable
  • userid - userid of the user whose variable you want to inspect
  • varname - name of the network-related client-side variable you'd like to inspect


Examples

player_activate.cfg

es_setinfo checkvar 0
es_getclientvar checkvar event_var(userid) rate
es_msg event_var(es_username) has joined and has their "rate" set to server_var(checkvar)

other example: in player_activate.cfg

es_setinfo checkvar 0
es_getclientvar checkvar event_var(userid) cl_language
if (server_var(checkvar) = "french") then es_tell event_var(userid) "Bonjour et bienvenue"
if (server_var(checkvar) = "english") then es_tell event_var(userid) "Hello and welcome"

Give you the language of the game used by the player (english, french, german, italian...)



Notes

  • Can only obtain network variables from the client. For example: rate, cl_interp, cl_interpolate, cl_cmdrate, cl_updaterate
  • These variables are likely only available at player_activate and later.
  • The most common use for es_getclientvar is to detect bad rate values for players. Some scripts have used es_cexec to force the client to change the values to something the admin feels is more acceptable for the server.
  • You cannot read binds for a player.
  • This command is almost useless for catching cheat programs.


See also

blog comments powered by Disqus