Hello, I expose my 2nd problem, Once my SQL information recupére sucks, I wanted returned in the form of button, but this does not work, a hand would be welcome, I do not see any where from can come my problem
Sorry for my english, Google translation
Client :
JobsPublicList = {}
function CloseMenu()
Menu.hidden = true
end
RegisterNetEvent("itexzoz_test")
AddEventHandler("itexzoz_test", function(json_encode)
print(json_encode)
JobsPublicList = json_encode
end)
function PoleEmploisMenu()
options.menu_subtitle = 'Bienvenue au Pole Emplois'
ClearMenu()
TriggerServerEvent('entreprise_jobs_annonce:public_entreprise')
for i, k in ipairs(JobsPublicList) do
Citizen.Wait(100)
Menu.addButton(k.custome_name, "CloseMenu", nil)
end
Menu.addButton(TEXT.CloseMenu, "CloseMenu", nil)
end
server :
LogsShow = true
function LogsConsole(arg)
local arg = arg
if LogsShows == true then
else
print(arg)
end
end
RegisterServerEvent('entreprise_jobs_annonce:public_entreprise')
AddEventHandler('entreprise_jobs_annonce:public_entreprise', function()
local source = source
MySQL.Async.fetchAll("SELECT * FROM entreprise WHERE entreprise_status = @entreprise_status ", { ['@entreprise_status'] = 1 }, function(result)
if result ~= nil then
for k, v in pairs(result) do
Data = json.encode({ custome_name = result[k].custome_name })
TriggerClientEvent('itexzoz_test', source, Data)
LogsConsole(Data)
end
end
end)
end)