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| | {{FuncDescription|Get the specified client's location.}} | ||
{{FuncSyntax|GetPlayerLocation(player)}} | {{FuncSyntax|GetPlayerLocation(player)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|player| | {{FuncParam|player|The client identifier (unneeded in client)}} | ||
{{FuncReturnValue| | {{FuncReturnValue|The client's location.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
AddEvent("OnRenderHUD", function() | |||
local x, y, z = GetPlayerLocation() | |||
AddPlayerChat("Player location: "..x..", "..y..", "..z) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[SetPlayerLocation]] |
Revision as of 14:42, 14 November 2019
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)