Es getplayername

From EventScripts Community Encyclopedia


Overview

Syntax: es_getplayername <variable> <userid>

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_xgetplayername

Description

Stores the user's name in the variable specified.

Parameters

  • variable - Variable which will store the player's name
  • userid - User id of the player


Examples

// Get the player's name and display it to everyone
es_xsetinfo playername 0
es_getplayername playername event_var(userid)
es_msg Say hello to server_var(playername)
Event player_activate
{
// Does the same as above but faster and without the need of a pre-set variable.
es_msg Say hello to event_var(username)
}


Notes

  • The server could crash if the provieded userid does not exists!
  • variable will equal 0 if the player does not exist.
  • Used mostly for games that do not support event_var(username), and client cmds.


See also

blog comments powered by Disqus