3DTEXTINFO

Warklot

Известный
Автор темы
112
3
Версия MoonLoader
Другое
как изменить диапазон поиска для 3dtext потому что теперь вам нужно быть очень близко, чтобы скрипт работал
если расстояние больше чем >30 это останавливаетс
я использовал переводчик гугл

Lua:
local exist = sampIs3dTextDefined(i)
    if exist then
        local text, color, vx, vy, vz, distance, ignoreWalls, pID, vID = sampGet3dTextInfoById(i)
        if text:find("business") then
    
        local GET_COORDS_X, GET_COORDS_Y = convert3DCoordsToScreen(vx, vy, vz)
local GET_COORDS_me_X, GET_COORDS_me_Y = convert3DCoordsToScreen(meposX, meposY, meposZ)
local dist = getDistanceBetweenCoords3d (vx, vy, vz, meposX, meposY, meposZ)
renderDrawLine(GET_COORDS_X, GET_COORDS_Y ,GET_COORDS_me_X, GET_COORDS_me_Y, 1.1, 0xFFD00000)
renderFontDrawText(font,"distance "..dist, GET_COORDS_X, GET_COORDS_Y, -1)

              
        end
    end
 

hnnssy

Известный
Друг
2,684
2,769
как изменить диапазон поиска для 3dtext потому что теперь вам нужно быть очень близко, чтобы скрипт работал
если расстояние больше чем >30 это останавливаетс
я использовал переводчик гугл

Lua:
local exist = sampIs3dTextDefined(i)
    if exist then
        local text, color, vx, vy, vz, distance, ignoreWalls, pID, vID = sampGet3dTextInfoById(i)
        if text:find("business") then
   
        local GET_COORDS_X, GET_COORDS_Y = convert3DCoordsToScreen(vx, vy, vz)
local GET_COORDS_me_X, GET_COORDS_me_Y = convert3DCoordsToScreen(meposX, meposY, meposZ)
local dist = getDistanceBetweenCoords3d (vx, vy, vz, meposX, meposY, meposZ)
renderDrawLine(GET_COORDS_X, GET_COORDS_Y ,GET_COORDS_me_X, GET_COORDS_me_Y, 1.1, 0xFFD00000)
renderFontDrawText(font,"distance "..dist, GET_COORDS_X, GET_COORDS_Y, -1)

             
        end
    end
use raknet hook to catch the creating of 3d text labels
 

Warklot

Известный
Автор темы
112
3
but in general, dick understand what this native needs, limit the search to 30 meters or he complains that it does not work if it is further 30
USE ENGLISH LANGUAGE. NO GOOGLE TRANSLATE PLS. WE ARE NOT A STUPID RUSSIANS.
Hi, sorry for that.
So my script only checks 3dtext if im close to it (~28meters) but i want it to be like ~60-100meters. Does raknet hook help? how to impliment it into my script
 

hnnssy

Известный
Друг
2,684
2,769
Hi, sorry for that.
So my script only checks 3dtext if im close to it (~28meters) but i want it to be like ~60-100meters. Does raknet hook help? how to impliment it into my script
use samp.lua
{'onCreate3DText', {id = 'int16'}, {color = 'int32'}, {position = 'vector3d'}, {distance = 'float'}, {testLOS = 'bool8'}, {attachedPlayerId = 'int16'}, {attachedVehicleId = 'int16'}, {text = 'encodedString4096'}}
 

Warklot

Известный
Автор темы
112
3
use samp.lua
{'onCreate3DText', {id = 'int16'}, {color = 'int32'}, {position = 'vector3d'}, {distance = 'float'}, {testLOS = 'bool8'}, {attachedPlayerId = 'int16 '}, {attachedVehicleId =' int16 '}, {text =' encodedString4096 '}}
mmm where i add this ? never used samp.lua so i don't even know where to put this in my script.
 

hnnssy

Известный
Друг
2,684
2,769
mmm where i add this ? never used samp.lua so i don't even know where to put this in my script.
Lua:
local sampev = require 'lib.samp.events'

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        -- main
    end
end

function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleID, text)
    -- code
end
 

Warklot

Известный
Автор темы
112
3
Lua:
local sampev = require 'lib.samp.events'

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        -- main
    end
end

function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleID, text)
    -- code
end
Lua:
local sampev = require 'lib.samp.events'

        function main()
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("businessl", function() active = not active sampAddChatMessage(active and "[Business] ON. " or "[Business] OFF", 0xC900FF, -1)
    end)
    sampAddChatMessage("Business checker", 0xC900FF)
    while true do wait(0)
    end
end

function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleID, text)
 
        if active then
        if text:find("Business") then

 sampAddChatMessage(text, 0xC900FF)
          
        end
        end
end


No response. where i did mistake?
 

hnnssy

Известный
Друг
2,684
2,769
Lua:
local sampev = require 'lib.samp.events'

        function main()
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("businessl", function() active = not active sampAddChatMessage(active and "[Business] ON. " or "[Business] OFF", 0xC900FF, -1)
    end)
    sampAddChatMessage("Business checker", 0xC900FF)
    while true do wait(0)
    end
end

function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleID, text)

        if active then
        if text:find("Business") then

sampAddChatMessage(text, 0xC900FF)
         
        end
        end
end


No response. where i did mistake?
did u install samp.lua lib?
 

Warklot

Известный
Автор темы
112
3
did u install samp.lua lib?
1613037801559.png

yes