Es getplayerlocation

From EventScripts Community Encyclopedia


Overview

Syntax: es_getplayerlocation <x> <y> <z> <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_xgetplayerlocation

Description

Obtains the current coordinates of a given player and stores the X, Y, and Z coordinates in <x>, <y>, and <z>.


Parameters

  • x Variable in which the X coordinate of a player is stored
  • y Variable in which the Y coordinate of a player is stored
  • z Variable in which the Z coordinate of a player is stored
  • userid - UserID of the target player


Examples

player_jump.cfg

es_xsetinfo player_x 0
es_xsetinfo player_y 0
es_xsetinfo player_z 0
es_getplayerlocation player_x player_y player_z event_var(userid)
es_msg event_var(es_username) is at server_var(player_x) server_var(player_y) server_var(player_z)


Notes

  • Coordinates are always taken at the bottom of the player's model, rather than the middle or the player's perspective.
  • This can be used to track dead players as well. The coordinates of dead players are tied to the coordinates of the person they are spectating when in first- and third-person views, and are independent when in free-look mode.


See also


--Faaip 19:10, 16 July 2006 (EDT)

blog comments powered by Disqus