ev = require("samp.events")
tp = 1
function main()
repeat
wait(0)
until isSampAvailable()
lua_thread.create(function ()
while true do
wait(0)
if scet then
printStringNow("wait, man [" .. math.random(10000, 500000) .. "]", 1)
else
time = 0
end
end
end)
sampRegisterChatCommand("ctp", function ()
res, x, y, z = getTargetBlipCoordinatesFixed()
if res and not isCharOnFoot(playerPed) then
coordmaster(x, y, z)
tp = tp + 1
end
end)
wait(-1)
end
function ev.onSendVehicleSync(slot0)
if not send then
return slot0
else
return false
end
end
function ev.onSetVehiclePos()
if pos then
return false
end
end
function sendIncarSync(slot0, slot1, slot2)
slot3 = samp_create_sync_data("vehicle")
slot3.position = {
slot0,
slot1,
slot2
}
slot3.quaternion[0], slot3.quaternion[1], slot3.quaternion[2], slot3.quaternion[3] = getVehicleQuaternion(car)
slot3.moveSpeed = {
-0,
-0,
-0.666
}
slot3.send()
end
function getTargetBlipCoordinatesFixed()
slot0, slot1, slot2, slot3 = getTargetBlipCoordinates()
if not slot0 then
return false
end
requestCollision(slot1, slot2)
loadScene(slot1, slot2, slot3)
slot8, slot9, slot10, slot11 = getTargetBlipCoordinates()
return slot4, slot5, slot6, slot7
end
function samp_create_sync_data(slot0, slot1)
slot2 = require("ffi")
slot3 = require("sampfuncs")
slot4 = require("samp.raknet")
slot9 = tonumber(slot2.cast("uintptr_t", slot2.new(slot7 .. "*", slot2.new(slot7, {}))))
if (slot1 or true) and slot6[3] then
slot11, slot12 = nil
if slot1 == true then
slot11, slot12 = sampGetPlayerIdByCharHandle(PLAYER_PED)
else
slot12 = tonumber(slot1)
end
slot10(slot12, slot9)
end
return setmetatable({
send = function ()
slot0 = raknetNewBitStream()
raknetBitStreamWriteInt8(slot0, uv0[2])
raknetBitStreamWriteBuffer(slot0, uv1, uv2.sizeof(uv3))
raknetSendBitStreamEx(slot0, uv4.HIGH_PRIORITY, uv4.UNRELIABLE_SEQUENCED, 1)
raknetDeleteBitStream(slot0)
end
}, {
__index = function (slot0, slot1)
return uv0[slot1]
end,
__newindex = function (slot0, slot1, slot2)
uv0[slot1] = slot2
end
})
end
function coordmaster(slot0, slot1, slot2)
lua_thread.create(function ()
if tp > 5 then
sampAddChatMessage("Бесплатная версия только 5 телепортов за сессию.", -1)
sampAddChatMessage("Убрать это ограничение - 50 рублей.", -1)
sampAddChatMessage("Контакты для покупки: vk.com/0id6666666", -1)
thisScript():unload()
else
slot1 = storeCarCharIsInNoSave(PLAYER_PED)
slot6, slot7, slot4 = getCarCoordinates(slot1)
pos = true
scet = true
send = true
freezeCarPositionAndDontLoadCollision(slot1, true)
setCarCoordinatesNoOffset(slot1, uv0, uv1, uv2)
while true do
wait(0)
if 20 < getDistanceBetweenCoords2d(slot2, slot3, uv0, uv1) then
sendIncarSync(slot2, slot3 + math.cos(getAngle(slot2, slot3, uv0, uv1)) * 20, slot4)
sampForceVehicleSync(slot1)
wait(38)
else
sendIncarSync(uv0, uv1, uv2)
setCarCoordinates(slot1, uv0, uv1, uv2)
sendIncarSync(uv0, uv1, uv2)
lockPlayerControl(false)
sampForceVehicleSync(slot1)
send, pos = nil
scet = false
freezeCarPositionAndDontLoadCollision(slot1, false)
break
end
end
end
end)
end
function getAngle(slot0, slot1, slot2, slot3)
return math.atan2(slot2 - slot0, slot3 - slot1)
end