- Версия MoonLoader
- Другое
lua:
require "moonloader"
local sampev = require "lib.samp.events"
local autotpEnabled = false
function main()
while not isSampAvailable() do wait(50) end
sampAddChatMessage("{3498DB}Auto TP by V - {2ECC71}/tpon", -1)
sampRegisterChatCommand("tpon", function()
autotpEnabled = not autotpEnabled
if autotpEnabled then
sampAddChatMessage("{2471A3}AutoTP{FFFFFF} has been {0FFF00}Enabled", -1)
else
sampAddChatMessage("{2471A3}AutoTP{FFFFFF} has been {FF0000}Disabled", -1)
end
end)
while true do
wait(1)
end
end
function sampev.onServerMessage(color, text)
if autotpEnabled and string.find(text, "привет") then
lua_thread.create(function()
wait(3000)
teleportToCheckpoint()
end)
end
end
function teleportToCheckpoint()
-- Get the player's current checkpoint position
local checkpointPos = sampGetCheckpointPos()
-- Set the player's position to the checkpoint position
sampSetPlayerPos(checkpointPos.x, checkpointPos.y, checkpointPos.z)
end