OnPlayerTeleport: Difference between revisions
Jump to navigation
Jump to search
Imfelipedev (talk | contribs) No edit summary |
Imfelipedev (talk | contribs) |
||
Line 5: | Line 5: | ||
{{Note|The sensitivity threshold can be adjusted through the '''player_teleport_alert''' setting, which accepts values between 5 and 500 (default: 100).}} | {{Note|The sensitivity threshold can be adjusted through the '''player_teleport_alert''' setting, which accepts values between 5 and 500 (default: 100).}} | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | |||
float previousX, float previousY, float previousZ, float currentX, float currentY, float currentZ | |||
</syntaxhighlight> | |||
*'''previousX''': A [[float]] representing the player X-coordinate before teleporting. | |||
*'''previousY''': A [[float]] representing the player Y-coordinate before teleporting. | |||
*'''previousZ''': A [[float]] representing the player Z-coordinate before teleporting. | |||
*'''currentX''': A [[float]] representing the player current X-coordinate after teleporting. | |||
*'''currentY''': A [[float]] representing the player current Y-coordinate after teleporting. | |||
*'''currentZ''': A [[float]] representing the player current Z-coordinate after teleporting. | |||
==Source== | ==Source== |
Revision as of 23:28, 4 February 2025
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.
Parameters
float previousX, float previousY, float previousZ, float currentX, float currentY, float currentZ
- previousX: A float representing the player X-coordinate before teleporting.
- previousY: A float representing the player Y-coordinate before teleporting.
- previousZ: A float representing the player Z-coordinate before teleporting.
- currentX: A float representing the player current X-coordinate after teleporting.
- currentY: A float representing the player current Y-coordinate after teleporting.
- currentZ: A float representing the player current Z-coordinate after teleporting.
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