GetPlayerPosition: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 31: Line 31:
* Coordinates returned by this function are in metres, not Unreal units.
* Coordinates returned by this function are in metres, not Unreal units.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Player Functions]]
[[Category:Player Functions]]

Latest revision as of 09:53, 15 August 2026

getPlayerPosition

Returns the latest authoritative snapshot position of a player in metres.

Syntax

table getPlayerPosition(int playerId)

Parameters

Name Type Required Description
playerId int yes The connected player identifier.

Returns

Returns a table with x, y, z and numeric indices 1..3, or false when unavailable.

Examples

Read a player's position:

local position = getPlayerPosition(playerId)
if position then
    print(position.x, position.y, position.z)
end

Notes

  • Available only in server-side resource scripts.
  • Coordinates returned by this function are in metres, not Unreal units.