OnPlayerTeleport

From Multi Theft Auto: Wiki
Revision as of 01:34, 31 January 2025 by Imfelipedev (talk | contribs)
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 direct server intervention, such as the use of setElementPosition or spawnPlayer.

During intervals defined by the player_teleport_alert setting, the server monitors player positions to detect significant unexpected movements. If a player's position deviates beyond the established threshold without server functions like setElementPosition or spawnPlayer being used, this event will be triggered.

[[{{{image}}}|link=|]] Note: The sensitivity threshold can be adjusted through the player_teleport_alert setting, which accepts values 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

This example will disconnect the suspected player from the server and display a warning about the teleport.

addEventHandler("onPlayerTeleport", root, function()
    kickPlayer(source, "AC", "You were disconnected from the server for attempting to teleport. If this was a mistake, please contact the administration.")
end)

See Also

Player events


Event functions