Server-side event

onPlayerTeleport

From Multi Theft Auto: Wiki
Revision as of 07:34, 29 January 2025 by Xenius (talk | contribs) (Created page with "__NOTOC__ {{Server event}} {{Added feature/item|1.6.1|1.6.0|22930|This event is triggered when a player's position changes significantly without being caused by setElementPosition.}} During each interval (''player_teleport_alert''), the server monitors player positions and checks for significant unexpected movements. If a player's position deviates beyond the defined threshold without using setElementPosition, this event will be fired. The threshold can...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

BETA: NEW FEATURE (BUILD: 1.6.0 r22930)
This event is triggered when a player's position changes significantly without being caused by setElementPosition.

During each interval (player_teleport_alert), the server monitors player positions and checks for significant unexpected movements. If a player's position deviates beyond the defined threshold without using setElementPosition, this event will be fired.

The threshold can be configured using player_teleport_alert, which can be set between 5 and 500 (default: 100).

Parameters

None

Source

The source of this event is the player who triggered the teleport detection.

Canceling

Canceling this event has no effect.

Example

  
function handlePlayerTeleportCheat()  
    outputChatBox("Stop teleporting!", source)
end  
addEventHandler("onPlayerTeleport", root, handlePlayerTeleportCheat)  

See Also

Player events


Event functions