Hello FiveM forums, If I create this topic is that I find no solution to my problem. Explanation!
In my LUA menu I want to display the information present in one of my MYSQL tables;
Except that many attempts not functional I look on yours help!
I recover with success the information of my table but I do not know how to convert them afins these appear as a button in my menu LUA
(Sorry for my english google translation)
Here is my code now, If you could help me with the complete
server/server.lua
RegisterNetEvent('journaliste:helicoptaire_menu_vehicle')
AddEventHandler('journaliste:helicoptaire_menu_vehicle', function()
local source = source
MySQL.Async.fetchAll("SELECT * FROM entreprise_vehicle WHERE entreprise_id = @entreprise_id AND vehicle_type = @vehicle_type", { ['@entreprise_id'] = entreprise_journaliste_id, ['@vehicle_type'] = 'helico' }, function(result)
if result ~= nil then
for k, v in pairs(result) do
print('open menu helicoptaire_menu_vehicle - ' .. result[k].vehicle_spawn_name .. ' ID :' .. result[k].id)
end
end
end)
end)
client/client.lua (Menu LUA)
function MenuWeazelNewsHelicoptaire()
options.menu_subtitle = 'Garage Helicoptaire : Weazel News'
ClearMenu()
TriggerServerEvent('journaliste:helicoptaire_menu_vehicle')
Menu.addButton('~r~Fermer ', "CloseMenu", nil)
end
Thank you for your future help
Discord : iTexZoz - Dylan M.#4280