TeleportPlayer

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 20:14, 5 August 2026 by QCherry (talk | contribs) (Automatyczna aktualizacja dokumentacji funkcji)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

teleportPlayer

Teleports a connected player to an authoritative world position.

Syntax

bool teleportPlayer(int playerId, number x, number y, number z [, number yaw = 0])

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
x number yes World X coordinate in metres.
y number yes World Y coordinate in metres.
z number yes World Z coordinate in metres.
yaw number no Optional actor yaw in degrees; defaults to 0.

Returns

Returns true when the teleport is accepted and queued; otherwise returns false.

Examples

Teleport a player to an RP spawn point:

teleportPlayer(playerId, 125.5, -48.0, 3.25, 180)

Notes

  • Available only in server-side resource scripts.
  • This is the explicit teleport alias of setPlayerPosition and emits onPlayerTeleport.
  • Coordinates use metres and yaw uses degrees.