OnPlayerTeleport: Difference between revisions
Jump to navigation
Jump to search
(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...") |
Imfelipedev (talk | contribs) |
||
Line 16: | Line 16: | ||
Canceling this event has no effect. | Canceling this event has no effect. | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | This example will disconnect the suspected player from the server and display a warning about the teleport. | ||
function | <syntaxhighlight lang="lua"> | ||
addEventHandler("onPlayerTeleport", root, function() | |||
end | kickPlayer(source, "AC", "You were disconnected from the server for attempting to teleport. If this was a mistake, please contact the administration.") | ||
end) | |||
</syntaxhighlight> | |||
{{See also/Server event|Player events}} | {{See also/Server event|Player events}} |
Revision as of 19:35, 29 January 2025
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
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
- onPlayerACInfo
- onPlayerBan
- onPlayerChangeNick
- onPlayerChat
- onPlayerClick
- onPlayerCommand
- onPlayerConnect
- onPlayerContact
- onPlayerDamage
- onPlayerJoin
- onPlayerLogin
- onPlayerLogout
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerModInfo
- onPlayerMute
- onPlayerNetworkStatus
- onPlayerPickupHit
- onPlayerPickupLeave
- onPlayerPickupUse
- onPlayerPrivateMessage
- onPlayerQuit
- onPlayerScreenShot
- onPlayerSpawn
- onPlayerStealthKill
- onPlayerTarget
- onPlayerUnmute
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerVoiceStart
- onPlayerVoiceStop
- onPlayerWasted
- onPlayerWeaponFire
- onPlayerWeaponSwitch
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled