как телепортироваться по чекпоинту

uc_Rf_221.2

Новичок
Автор темы
23
3
Версия MoonLoader
.026-beta
Я не знаю как тпхаться по чекпоинту. Помогите плз
 

barjik

Известный
464
190
пример тп:
Lua:
function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand('tp', function()
    local result, x, y, z = SearchMarker(posX, posY, posZ, 9999999, true)
        if result then
            setCharCoordinates(playerPed, x, y, z)
        else
            sampAddChatMessage('error.', -1)
        end
    end)
    wait(-1)
end

function SearchMarker(posX, posY, posZ, radius, isRace)
    local ret_posX = 0.0
    local ret_posY = 0.0
    local ret_posZ = 0.0
    local isFind = false

    for id = 0, 31 do
        local MarkerStruct = 0
        if isRace then MarkerStruct = 0xC7F168 + id * 56
        else MarkerStruct = 0xC7DD88 + id * 160 end
        local MarkerPosX = representIntAsFloat(readMemory(MarkerStruct + 0, 4, false))
        local MarkerPosY = representIntAsFloat(readMemory(MarkerStruct + 4, 4, false))
        local MarkerPosZ = representIntAsFloat(readMemory(MarkerStruct + 8, 4, false))

        if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
            end
        end
    end

    return isFind, ret_posX, ret_posY, ret_posZ
end
 
Последнее редактирование: