Configuration
This section includes all configurable files for the selected script. Most settings are configured automatically, but each config.lua file contains a header comment explaining the purpose and usage of every configuration type. Be sure to read the header of each file carefully to fully understand how to customize and adapt the system for QBCORE, ESX, or standalone environments, ensuring seamless integration with your server.
qs-textui/shared/config.lua
Config = {
DefaultKey = {
Enable = true,
Key = 'E'
},
Areas = {
{
data = {
type = '3dtext', -- 3dtext or textui
coords = vector3(192.606598, -1712.017578, 29.650513),
displayDist = 8,
interactDist = 2,
enableKeyClick = true,
keyNum = 38, -- Key number
key = 'E', -- Key name
text = 'Knock on Tony\'s door',
job = 'all'
},
onKeyClick = function()
-- Write your export or events here
end
},
{
data = {
type = 'textui', -- textui or 3dtext
coords = vector3(182.096710, -1704.646118, 29.279907),
dist = 5,
keyNum = 38, -- Key number
key = 'E', -- Key name
text = 'Steal Tony\'s Car',
job = 'all'
},
onKeyClick = function()
-- Write your export or events here
end
}
}
}
-- Alignments:
-- top-left
-- top-right
-- bottom-left
-- bottom-right
-- top-center
-- bottom-center
-- center
-- center-left
-- center-right
Config.DefaultAlign = 'center-right'
Config.Colors = {
insideBackground = [[
radial-gradient(
50% 50% at 50% 50%,
#006299 0%,
#00a3ff 100%
)
]],
insideBoxShadow = '0px 0px 22px 0px rgba(0, 163, 255, 0.8)',
insideBorder = '4px solid #0190e1',
backgroundAnimateColor = 'rgba(0, 163, 255, 1)'
}
local frameworks = {
['es_extended'] = 'esx',
['qb-core'] = 'qb',
['qbx_core'] = 'qb'
}
local function dependencyCheck(data)
for k, v in pairs(data) do
if GetResourceState(k):find('started') ~= nil then
return v
end
end
return false
end
Config.Framework = dependencyCheck(frameworks)
Config.Debug = false
-- EXAMPLE
-- function createTextUIAtCoords(coords, text, key)
-- Citizen.CreateThread(function()
-- local isShowing = false -- Controla si el TextUI está visible
-- while true do
-- local sleep = 1000
-- local playerCoords = GetEntityCoords(PlayerPedId())
-- local dist = #(coords - playerCoords)
-- if dist <= 5.0 then -- Distancia para mostrar el TextUI
-- sleep = 0
-- if not isShowing then
-- displayTextUI(text, key) -- Muestra el TextUI
-- isShowing = true
-- end
-- else
-- if isShowing then
-- hideTextUI() -- Oculta el TextUI si se aleja
-- isShowing = false
-- end
-- end
-- Wait(sleep)
-- end
-- end)
-- end
-- RegisterNetEvent('example:interaction')
-- AddEventHandler('example:interaction', function(data)
-- print(data.message) -- Muestra el mensaje en la consola del cliente
-- end)
-- create3DText('example_3dtext', vector3(249.059341, -391.186798, 45.876953), 'Presiona ~g~E~s~ para interactuar', 'example:interaction', { message = '¡Has interactuado!' })
-- createTextUIAtCoords(vector3(243.125275, -387.903290, 45.590454), 'Texto visible aquí', 'E')