function carTeleport(x, y, z)
nopHook("onSendPacket", true)
lockPlayerControl(false)
coordmaster(x, y, z)
end
function coordmaster(x, y, z)
local step = 6
local car = storeCarCharIsInNoSave(PLAYER_PED)
local cx, cy, cz = getCarCoordinates(car)
local angle = getAngle(cx, cy, x, y)
while true do
wait(0)
printStringNow("~Y~Loading...~s~", 50)
if getDistanceBetweenCoords2d(cx, cy, x, y) > step then
cx = cx + math.sin(angle) * step
cy = cy + math.cos(angle) * step
sendInCarFakePosition(cx, cy, cz)
else
sendInCarFakePosition(x, y, z)
setCarCoordinates(car, x, y, z)
nopHook("onSendPacket", false)
lockPlayerControl(false)
sampAddChatMessage('{f5c011}[MultiPack] {ffffff} {FFFFFF}| {00FF00}[Успешно] {FFFFFF}Телепортация выполнена!', -1)
addOneOffSound(0.0, 0.0, 0.0, 1139)
break
end
end
end