Перепишите скрипт пожалуйста

Mhkodka

Участник
Автор темы
72
2
Версия SA-MP
  1. 0.3.7 (R1)
  2. 0.3.7-R2
  3. 0.3.7-R3
  4. 0.3.7-R4
  5. 0.3e (R1) / CR-MP
  6. CR-MP 0.3.7
Тут короче приколюха такая . Есть скрипт чекпоинтмастер для радмира ну так вот. Ербаев написал мне,но он тпает но чекпоинт не берёт и дёргает. Если не сложно напишите правильно.
Скрипт


Lua:
local active = false

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("cmaster", function()
        active = not active
        print(active and "+" or "-")
    end)
    while true do wait(0)
        if active then
            res, x, y, z = SearchMarker()
            if res then
                setCharCoordinates(playerPed, x, y, z)
            end
        end
    end
end

function SearchMarker(posX, posY, posZ)
    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
        MarkerStruct = 0xC7F168 + id * 56
        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
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
        end
    end
    return isFind, ret_posX, ret_posY, ret_posZ
  end
 
Последнее редактирование:

Mhkodka

Участник
Автор темы
72
2
Шизик? Ты пишешь что он вообще не тпает, теперь пишешь не может нормально тпнутся.
Типо смотри. Меня тпает чекпоинт не берёт и дёргает. Я просто не так высказал мысль.
 

azimoff

azimoff
Проверенный
90
70
Lua:
local ev = require 'lib.samp.events'

local active = false
local d = true

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("cmaster", function()
        active = not active
        print(active and "+" or "-")
    end)
    while true do wait(0)
        if active then
            res, x, y, z = SearchMarker()
            if res and d then
                setCharCoordinates(playerPed, x, y, z)
                d = false
            end
        end
    end
end

function ev.onDisableRaceCheckpoint()
d = true
end

function SearchMarker(posX, posY, posZ)
    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
        MarkerStruct = 0xC7F168 + id * 56
        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
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
        end
    end
    return isFind, ret_posX, ret_posY, ret_posZ
  end
попробуй так
 

Mhkodka

Участник
Автор темы
72
2
Lua:
local ev = require 'lib.samp.events'

local active = false
local d = false

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("cmaster", function()
        active = not active
        print(active and "+" or "-")
    end)
    while true do wait(0)
        if active then
            res, x, y, z = SearchMarker()
            if res and d then
                setCharCoordinates(playerPed, x, y, z)
                d = false
            end
        end
    end
end

function ev.onDisableRaceCheckpoint()
d = true
end

function SearchMarker(posX, posY, posZ)
    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
        MarkerStruct = 0xC7F168 + id * 56
        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
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
        end
    end
    return isFind, ret_posX, ret_posY, ret_posZ
  end
попробуй так
Завтра проверю
Lua:
local ev = require 'lib.samp.events'

local active = false
local d = true

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("cmaster", function()
        active = not active
        print(active and "+" or "-")
    end)
    while true do wait(0)
        if active then
            res, x, y, z = SearchMarker()
            if res and d then
                setCharCoordinates(playerPed, x, y, z)
                d = false
            end
        end
    end
end

function ev.onDisableRaceCheckpoint()
d = true
end

function SearchMarker(posX, posY, posZ)
    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
        MarkerStruct = 0xC7F168 + id * 56
        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
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
        end
    end
    return isFind, ret_posX, ret_posY, ret_posZ
  end
попробуй так
Но заранее спасибо
 

Mhkodka

Участник
Автор темы
72
2
Lua:
local ev = require 'lib.samp.events'

local active = false
local d = true

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("cmaster", function()
        active = not active
        print(active and "+" or "-")
    end)
    while true do wait(0)
        if active then
            res, x, y, z = SearchMarker()
            if res and d then
                setCharCoordinates(playerPed, x, y, z)
                d = false
            end
        end
    end
end

function ev.onDisableRaceCheckpoint()
d = true
end

function SearchMarker(posX, posY, posZ)
    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
        MarkerStruct = 0xC7F168 + id * 56
        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
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
        end
    end
    return isFind, ret_posX, ret_posY, ret_posZ
  end
попробуй так
Не работает