can you help me?

Runbu73

Участник
Автор темы
123
5
Spoiler:
if vxfullped.v then
                        local enPosGame = {getBodyPartCoordinates(8, handle)}
                        local point =
                        {
                            x = enPosGame[1] - 0.3,
                            y = enPosGame[2],
                            z = enPosGame[3]
                        }
                        local enPosScr = {convert3DCoordsToScreen(point.x, point.y, point.z)}
                        local distance = math.sqrt((math.pow((enPos[1] - myPos[1]), 2) + math.pow((enPos[2] - myPos[2]), 2) + math.pow((enPos[3] - myPos[3]), 2)))
                        renderFontDrawText(font, string.format('Speed: %.1f\nName: %s\nDistance: %.1f\nSkin: %d\nNPC: %s\nAFK: %s', getCharSpeed(handle), sampGetPlayerNickname(i), distance, getCharModel(handle), tostring(sampIsPlayerNpc(i)), tostring(sampIsPlayerPaused(i))), enPosScr[1], enPosScr[2], color)
                    end



I have this problem, when I activate the box the script exits. this is the code:
 

uvie

Известный
267
54
maybe you missing library??

require("library_name")



Lua:
if vxfullped.v then
    local enPosGame = getBodyPartCoordinates(8, handle)
    if enPosGame then -- Check if function returned values
        local point = {
            x = enPosGame[1] - 0.3,
            y = enPosGame[2],
            z = enPosGame[3]
        }
        local enPosScr = convert3DCoordsToScreen(point.x, point.y, point.z) -- Assuming it returns x, y, z
        local distance = math.sqrt((math.pow((enPos[1] - myPos[1]), 2) + math.pow((enPos[2] - myPos[2]), 2) + math.pow((enPos[3] - myPos[3]), 2)))
        renderFontDrawText(font, string.format('Speed: %.1f\nName: %s\nDistance: %.1f\nSkin: %d\nNPC: %s\nAFK: %s', getCharSpeed(handle), sampGetPlayerNickname(i), distance, getCharModel(handle), tostring(sampIsPlayerNpc(i)), tostring(sampIsPlayerPaused(i))), enPosScr[1], enPosScr[2], color)
    end
end
 

Runbu73

Участник
Автор темы
123
5
maybe you missing library??

require("library_name")



Lua:
if vxfullped.v then
    local enPosGame = getBodyPartCoordinates(8, handle)
    if enPosGame then -- Check if function returned values
        local point = {
            x = enPosGame[1] - 0.3,
            y = enPosGame[2],
            z = enPosGame[3]
        }
        local enPosScr = convert3DCoordsToScreen(point.x, point.y, point.z) -- Assuming it returns x, y, z
        local distance = math.sqrt((math.pow((enPos[1] - myPos[1]), 2) + math.pow((enPos[2] - myPos[2]), 2) + math.pow((enPos[3] - myPos[3]), 2)))
        renderFontDrawText(font, string.format('Speed: %.1f\nName: %s\nDistance: %.1f\nSkin: %d\nNPC: %s\nAFK: %s', getCharSpeed(handle), sampGetPlayerNickname(i), distance, getCharModel(handle), tostring(sampIsPlayerNpc(i)), tostring(sampIsPlayerPaused(i))), enPosScr[1], enPosScr[2], color)
    end
end
lack of which library? can tell me?

Ícone Verificada pela comunidade


maybe you missing library??

require("library_name")



Lua:
if vxfullped.v then
    local enPosGame = getBodyPartCoordinates(8, handle)
    if enPosGame then -- Check if function returned values
        local point = {
            x = enPosGame[1] - 0.3,
            y = enPosGame[2],
            z = enPosGame[3]
        }
        local enPosScr = convert3DCoordsToScreen(point.x, point.y, point.z) -- Assuming it returns x, y, z
        local distance = math.sqrt((math.pow((enPos[1] - myPos[1]), 2) + math.pow((enPos[2] - myPos[2]), 2) + math.pow((enPos[3] - myPos[3]), 2)))
        renderFontDrawText(font, string.format('Speed: %.1f\nName: %s\nDistance: %.1f\nSkin: %d\nNPC: %s\nAFK: %s', getCharSpeed(handle), sampGetPlayerNickname(i), distance, getCharModel(handle), tostring(sampIsPlayerNpc(i)), tostring(sampIsPlayerPaused(i))), enPosScr[1], enPosScr[2], color)
    end
end
These are my libraries:

Ícone Verificada pela comunidade

require("lib.moonloader")
local inicfg = require ('inicfg')
local imgui = require "imgui"
local vKeys = require('vKeys')
local sampfuncs = require "sampfuncs"
local memory = require 'memory'
local ffi = require "ffi"
local events = require 'lib.samp.events'
local sampev = require('lib.samp.events')
local hack = require 'lib.samp.events'
local encoding = require "encoding"
encoding.default = "CP1251"
local u8 = encoding.UTF8
local fa = require 'fAwesome5'
local fa_font = nil
local getbonePosition = ffi.cast("int (__thiscall*)(void*, float*, int, bool)", 0x5E4280)
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
if fa_font == nil then
local font_config = imgui.ImFontConfig()
font_config.MergeMode = true

fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
end
 
  • Bug
Реакции: Corenale

sVor

Активный
156
90
lack of which library? can tell me?

Посмотреть вложение 232584


These are my libraries:

Посмотреть вложение 232586
require("lib.moonloader")
local inicfg = require ('inicfg')
local imgui = require "imgui"
local vKeys = require('vKeys')
local sampfuncs = require "sampfuncs"
local memory = require 'memory'
local ffi = require "ffi"
local events = require 'lib.samp.events'
local sampev = require('lib.samp.events')
local hack = require 'lib.samp.events'
local encoding = require "encoding"
encoding.default = "CP1251"
local u8 = encoding.UTF8
local fa = require 'fAwesome5'
local fa_font = nil
local getbonePosition = ffi.cast("int (__thiscall*)(void*, float*, int, bool)", 0x5E4280)
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
if fa_font == nil then
local font_config = imgui.ImFontConfig()
font_config.MergeMode = true

fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
end
getBodyPartCoordinates function does not exist. Replace it with
Lua:
local enPosGame = {getCharCoordinates(handle)}
Or send moonloader.log to understand what the problem is.
 

sVor

Активный
156
90
What is the whiledo function?
Is it possible to see the entire block of code that fails?
 

Runbu73

Участник
Автор темы
123
5
Lua:
if vxfullped.v then
    local enPosGame = {getCharCoordinates(handle)}
    if enPosGame then -- Check if function returned values
        local point = {
            x = enPosGame[1] - 0.3,
            y = enPosGame[2],
            z = enPosGame[3]
        }
        local enPosScr = convert3DCoordsToScreen(point.x, point.y, point.z) -- Assuming it returns x, y, z
        local distance = math.sqrt((math.pow((enPos[1] - myPos[1]), 2) + math.pow((enPos[2] - myPos[2]), 2) + math.pow((enPos[3] - myPos[3]), 2)))
        renderFontDrawText(font, string.format('Speed: %.1f\nName: %s\nDistance: %.1f\nSkin: %d\nNPC: %s\nAFK: %s', getCharSpeed(handle), sampGetPlayerNickname(i), distance, getCharModel(handle), tostring(sampIsPlayerNpc(i)), tostring(sampIsPlayerPaused(i))), enPosScr[1], enPosScr[2], color)
    end
end
 

sVor

Активный
156
90
The situation has not changed.
What is the whiledo function?
It is not on the given code block.
 

Runbu73

Участник
Автор темы
123
5
The situation has not changed.
What is the whiledo function?
It is not on the given code block.
Lua:
function whiledo()
if anticapt.v and getCharHealth(PLAYER_PED) <= 25 then
setCharHealth(PLAYER_PED, 0)
end

if rklad.v then
for _, v in pairs(getAllObjects()) do
if isObjectOnScreen(v) then
local result, oX, oY, oZ = getObjectCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(oX,oY,oZ)
local objmodel = getObjectModel(v)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
distance = string.format("%.0f", getDistanceBetweenCoords3d(oX,oY,oZ, x2, y2, z2))
if objmodel == 19056 then renderDrawLine(x10, y10, x1, y1, 1.1, 0xFFD00000) renderFontDrawText(font,"Tesouro!\n{ff0000}Distancia: "..distance, x1, y1, -1) end
end
end
while true do wait(0)
imgui.Process = one1.v or one2.v

if os.clock() - 0.1 > rvTimerr and rv then
sampForceOnfootSync()
rvTimerr = os.clock()
end

if wasKeyPressed(VK_INSERT) then
one1.v = not one1.v
end

pStSet = sampGetServerSettingsPtr()
NTdist = memory.getfloat(pStSet + 39)
NTwalls = memory.getint8(pStSet + 47)

whiledo()

if rklad3.v then
for _, v in pairs(getAllObjects()) do
if isObjectOnScreen(v) then
local result, oX, oY, oZ = getObjectCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(oX,oY,oZ)
local objmodel = getObjectModel(v)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
distance = string.format("%.0f", getDistanceBetweenCoords3d(oX,oY,oZ, x2, y2, z2))
if objmodel == 1272 then renderDrawLine(x10, y10, x1, y1, 1.1, 0xFFD00000) renderFontDrawText(font,"Casa encontrada!\n{ff0000}Distancia: "..distance, x1, y1, -1) end
end
end
end
 

sVor

Активный
156
90
getBodyPartCoordinates function does not exist. Replace it with
Lua:
local enPosGame = {getCharCoordinates(handle)}
Or send moonloader.log to understand what the problem is.
Check that the character's handle is received correctly, or send a piece of code that implements it.

Lua:
function whiledo()
if anticapt.v and getCharHealth(PLAYER_PED) <= 25 then
setCharHealth(PLAYER_PED, 0)
end

if rklad.v then
for _, v in pairs(getAllObjects()) do
if isObjectOnScreen(v) then
local result, oX, oY, oZ = getObjectCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(oX,oY,oZ)
local objmodel = getObjectModel(v)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
distance = string.format("%.0f", getDistanceBetweenCoords3d(oX,oY,oZ, x2, y2, z2))
if objmodel == 19056 then renderDrawLine(x10, y10, x1, y1, 1.1, 0xFFD00000) renderFontDrawText(font,"Tesouro!\n{ff0000}Distancia: "..distance, x1, y1, -1) end
end
end
while true do wait(0)
imgui.Process = one1.v or one2.v

if os.clock() - 0.1 > rvTimerr and rv then
sampForceOnfootSync()
rvTimerr = os.clock()
end

if wasKeyPressed(VK_INSERT) then
one1.v = not one1.v
end

pStSet = sampGetServerSettingsPtr()
NTdist = memory.getfloat(pStSet + 39)
NTwalls = memory.getint8(pStSet + 47)

whiledo()

if rklad3.v then
for _, v in pairs(getAllObjects()) do
if isObjectOnScreen(v) then
local result, oX, oY, oZ = getObjectCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(oX,oY,oZ)
local objmodel = getObjectModel(v)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
distance = string.format("%.0f", getDistanceBetweenCoords3d(oX,oY,oZ, x2, y2, z2))
if objmodel == 1272 then renderDrawLine(x10, y10, x1, y1, 1.1, 0xFFD00000) renderFontDrawText(font,"Casa encontrada!\n{ff0000}Distancia: "..distance, x1, y1, -1) end
end
end
end
This section of the code does not match what you threw above
 

Runbu73

Участник
Автор темы
123
5
Check that the character's handle is received correctly, or send a piece of code that implements it.


This section of the code does not match what you threw above
Do you have Telegram? we can talk better there

Ícone Verificada pela comunidade


Verifique se o handle do personagem foi recebido corretamente ou envie um trecho de código que o implemente.


Esta seção do código não corresponde ao que você lançou acima
 

Вложения

  • moonloader.log
    23.1 KB · Просмотры: 0