Bonsoir à tous, vous allez bien ?
Bon, j’explique mon soucis :
J’aimerais retirer 2 Drewtext quand je clique sur « Cacher HUD », avec trew HUD.
Voici le code /toggleHUD de trewhud :
Et voici les drewtext que j’aimerais effacé lorsqu’on appelle la fonction « NB:toggleuihud »
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
-- Store data for later
emsonline = 0
policeonline = 0
taxionline = 0
mechaniconline = 0
-- Get jobs data every 10 secconds
Citizen.CreateThread(function()
while true do
Citizen.Wait(10000)
ESX.TriggerServerCallback('guy293_getJobsOnline', function(ems, police, taxi, mechanic)
emsonline = ems
policeonline = police
taxionline = taxi
mechaniconline = mechanic
end)
end
end)
-- Print text
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
DrawText2(1.45, 1.449, 1.0,1.0,0.45, "👮: " .. policeonline , 0 ,119, 255, 150)
DrawText2(1.42, 1.449, 1.0,1.0,0.45, "🚑: " .. emsonline , 246 ,56, 56, 150)
DrawText2(1.39, 1.449, 1.0,1.0,0.45, "🚖: " .. taxionline , 239 ,255, 0, 150)
DrawText2(1.36, 1.449, 1.0,1.0,0.45, "🛠️: " .. mechaniconline , 239 ,255, 0, 150)
end
end)
function DrawText2(x,y ,width,height,scale, text, r,g,b,a)
SetTextFont(4)
SetTextProportional(0)
SetTextScale(scale, 0.3)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0,255)
SetTextEdge(2, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x - width/2, y - height/2 + 0.005)
end
Citizen.CreateThread(function()
while true do
local id = GetPlayerServerId(PlayerId())
Citizen.Wait(0)
DrawTxt(2.26, 0.50, 2.75,1.0,0.40,"~w~Supr~b~emacy - ~r~ID: ~b~".. id .."~w~", 255,255,255,255)
end
end)
function DrawTxt(x,y ,width,height,scale, text, r,g,b,a)
SetTextFont(1)
SetTextProportional(0)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0,255)
SetTextEdge(2, 0, 0, 0, 255)
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x - width/2, y - height/2 + 0.005)
end