GetPlayerLocation: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Get the specified client's location.}}


{{FuncSyntax|GetPlayerLocation(player)}}
{{FuncSyntax|GetPlayerLocation(player)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|player|__EDIT_ME__}}
{{FuncParam|player|The client identifier (unneeded in client)}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|The client's location.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
AddEvent("OnRenderHUD", function()
local x, y, z = GetPlayerLocation()
AddPlayerChat("Player location: "..x..", "..y..", "..z)
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[SetPlayerLocation]]

Revision as of 14:42, 14 November 2019

GetPlayerLocation

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Get the specified client's location.

Syntax

GetPlayerLocation(player)

Parameters

  • player
    The client identifier (unneeded in client)

Return Value

  • The client's location.

Example

AddEvent("OnRenderHUD", function()
	local x, y, z = GetPlayerLocation()
	AddPlayerChat("Player location: "..x..", "..y..", "..z)
end)

See also