Хочу разобраться в скриптинге

D

deleted-user-524046

Гость
Автор темы
если кто то может и у кого то есть то накиньте пару кодов на то как делаются банальные читы по типу тп по метке или спидхак. Мне интересно в этом разобраться но нету полноценных гайдов. Если знаете полный гайд на луа для сампа киньте пожалуйста
 

Hinаta

Известный
783
358
это называется опкод или скриптовый API?
Это называется таблица опкодов
1695229622955.png
 

DeKzer

Известный
518
220
Простой телепорт по метке без всяких обходов

Lua:
local ev = require('lib.samp.events')

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand('govnotp', tp)
    while true do
        wait(0)
    end
end

function tp()
    result, x, y, z = getTargetBlipCoordinatesFixed()
    if result then
        setCharCoordinates(PLAYER_PED, x, y, z)
        printStringNow("Teleported!", 2000)
    else
        sampAddChatMessage("Вы не поставили метку на карте!", ffffff)
    end
end

function getTargetBlipCoordinatesFixed()
    local bool, x, y, z = getTargetBlipCoordinates(); if not bool then return false end
    requestCollision(x, y); loadScene(x, y, z)
    local bool, x, y, z = getTargetBlipCoordinates()
    return bool, x, y, z
end
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,776
11,226
D

deleted-user-524046

Гость
Автор темы
Простой телепорт по метке без всяких обходов

Lua:
local ev = require('lib.samp.events')

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand('govnotp', tp)
    while true do
        wait(0)
    end
end

function tp()
    result, x, y, z = getTargetBlipCoordinatesFixed()
    if result then
        setCharCoordinates(PLAYER_PED, x, y, z)
        printStringNow("Teleported!", 2000)
    else
        sampAddChatMessage("Вы не поставили метку на карте!", ffffff)
    end
end

function getTargetBlipCoordinatesFixed()
    local bool, x, y, z = getTargetBlipCoordinates(); if not bool then return false end
    requestCollision(x, y); loadScene(x, y, z)
    local bool, x, y, z = getTargetBlipCoordinates()
    return bool, x, y, z
end
Lua:
local ev = require('lib.samp.events')

function main()
    repeat wait(0) until isSampAvailable() -- если самп запущен
    sampRegisterChatCommand('govnotp', tp) -- не понял что за команда
    while true do -- то
        wait(0)
    end
end

function tp()
    result, x, y, z = getTargetBlipCoordinatesFixed() -- находит координаты игрока
    if result then
        setCharCoordinates(PLAYER_PED, x, y, z) -- тепает человека на координаты
        printStringNow("Teleported!", 2000) -- сообщение в чат
    else -- по другому
        sampAddChatMessage("Вы не поставили метку на карте!", ffffff) -- сообщение в чат
    end
end
 
function getTargetBlipCoordinatesFixed() -- ваще не понял за что отвечают последующие строчки
    local bool, x, y, z = getTargetBlipCoordinates(); if not bool then return false end
    requestCollision(x, y); loadScene(x, y, z)
    local bool, x, y, z = getTargetBlipCoordinates()
    return bool, x, y, z
end