Ayuda con CheckPoint

Niouro

Nuevo miembro
Mensajes
1
Puntuación de reacción
0
¿Hay alguna forma de detectar un CheckPoint creado por el servidor y obtener sus coordenadas? Lo he intentado, pero no lo logré. ¡Necesito ayuda!

Me equivoque de tema, solo le di a preguntas y me mando a Pawn.


Codigo:
local e = require 'lib.samp.events'
local f = renderCreateFont("Arial", 10, 5)
local a = nil
local b = false
local c = false

function main()
    while not isSampAvailable() do wait(500) end
    sampAddChatMessage("{FFFFFF}Cargado", -1)

    while true do wait(0)
        if b and a then
            local x, y, z = getCharCoordinates(PLAYER_PED)
            local d = getDistanceBetweenCoords3d(x, y, z, a.x, a.y, a.z)

            if d <= 200 then
                local sx, sy = convert3DCoordsToScreen(a.x, a.y, a.z + 1.2)
                if sx and sy then
                    renderFontDrawText(f, "CheckPoint", sx, sy, 0xFFFF0000)
                end
            end

            if d <= 2 and not c then
                sampAddChatMessage("{FFFFFF}Test", -1)
                c = true
            end
        end
    end
end

function e.onSetCheckpoint(p)
    a = p
    b = true
    c = false
end

function e.onDisableCheckpoint()
    b = false
    a = nil
    c = false
end
 
Última edición:
Código:
local e = require 'lib.samp.events'
local f = renderCreateFont("Arial", 10, 5)
local a = nil
local b = false
local c = false

function main()
    while not isSampAvailable() do wait(500) end
    sampAddChatMessage("{FFFFFF}Cargado", -1)

    while true do
        if b and a then
            local x, y, z = getCharCoordinates(PLAYER_PED)
            local d = getDistanceBetweenCoords3d(x, y, z, a.x, a.y, a.z)

            if d <= 200 then
                local sx, sy = convert3DCoordsToScreen(a.x, a.y, a.z + 1.2)
                if sx and sy then
                    renderFontDrawText(f, "CheckPoint", sx, sy, 0xFFFF0000)
                end
            end

            if d <= 2 and not c then
                sampAddChatMessage("{FFFFFF}Test", -1)
                c = true
            elseif d > 2.5 and c then
                c = false
            end

            wait(0)
        else
            wait(500)
        end
    end
end

function e.onSetCheckpoint(p)
    if p and p.x and p.y and p.z then
        a = p
        b = true
        c = false
    end
end

function e.onDisableCheckpoint()
    b = false
    a = nil
    c = false
end
 
Arriba