GetUserCVar

From ZDoom Wiki
Jump to: navigation, search

(New from 2.7.1)

int GetUserCVar (int playernumber, str cvar)

Usage

Returns the value of a particular user cvar of a specific player.

Parameters

  • playernumber: The number of the player (0 to 7).
  • cvar: name of a console variable to get the value from.

Return value

The value of the specified console variable. The console variable must also be a proper user variable, such as the ones found in Player settings. This is only useful for cvars that can be represented as integers. Also note that you can create your own user variables by using the CVARINFO lump.

If no such console variable exists, if the console variable is not a proper user variable, or if the player is not in game (or the number is not a valid player number) it will return 0.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.


See also

Console variable functions
GetCVar SetCVar
GetCVarString SetCVarString
GetUserCVar SetUserCVar
GetUserCVarString SetCVarString
CVARINFO