телепорт

IlyaHL2

Активный
Автор темы
210
53
Версия MoonLoader
.026-beta
Возможно ли изменить свои координаты так чтобы не сбивалась анимация, если да то как?
 
Решение
Из ClickWarp'а FYP'а.
Lua:
-- Отдельно.
function setCharCoordinatesDontResetAnim(char, x, y, z)
    if doesCharExist(char) then
        local ptr = getCharPointer(char)
        setEntityCoordinates(ptr, x, y, z)
    end
end

function setEntityCoordinates(entityPtr, x, y, z)
    if entityPtr ~= 0 then
        local matrixPtr = readMemory(entityPtr + 0x14, 4, false)
        if matrixPtr ~= 0 then
            local posPtr = matrixPtr + 0x30
            writeMemory(posPtr + 0, 4, representFloatAsInt(x), false) -- X
            writeMemory(posPtr + 4, 4, representFloatAsInt(y), false) -- Y
            writeMemory(posPtr + 8, 4, representFloatAsInt(z), false) -- Z
        end
    end
end
Lua:
-- Использование...

Dmitriy Makarov

25.05.2021
Проверенный
2,478
1,113
Из ClickWarp'а FYP'а.
Lua:
-- Отдельно.
function setCharCoordinatesDontResetAnim(char, x, y, z)
    if doesCharExist(char) then
        local ptr = getCharPointer(char)
        setEntityCoordinates(ptr, x, y, z)
    end
end

function setEntityCoordinates(entityPtr, x, y, z)
    if entityPtr ~= 0 then
        local matrixPtr = readMemory(entityPtr + 0x14, 4, false)
        if matrixPtr ~= 0 then
            local posPtr = matrixPtr + 0x30
            writeMemory(posPtr + 0, 4, representFloatAsInt(x), false) -- X
            writeMemory(posPtr + 4, 4, representFloatAsInt(y), false) -- Y
            writeMemory(posPtr + 8, 4, representFloatAsInt(z), false) -- Z
        end
    end
end
Lua:
-- Использование:
setCharCoordinatesDontResetAnim(PLAYER_PED, x, y, z)
 
  • Вау
  • Влюблен
Реакции: IlyaHL2, qdIbp и MLycoris