Hello, so I am using the aiomenu and I’m looking to add the posibility to have it show the license in proximity chat as well as there job beside there ID
I have the menu there
As well as have been working on the script its self for the job to displace beside the users first and last name
function getIdentity(source, callback)
local identifier = GetPlayerIdentifiers(source)[1]
MySQL.Async.fetchAll("SELECT * FROM `users` WHERE `identifier` = @identifier",
{
['@identifier'] = identifier
},
function(result)
if result[1] ~= nil then
local data = {
identifier = identifier,
firstname = result[1]['firstname'],
lastname = result[1]['lastname'],
dateofbirth = result[1]['dateofbirth'],
sex = result[1]['sex'],
height = result[1]['height'],
phonenumber = result[1]['phone_number'],
job = result[1]['job']
}
callback(data)
else
local data = {
identifier = '',
firstname = '',
lastname = '',
dateofbirth = '',
sex = '',
height = '',
phonenumber = '',
job = ''
}
callback(data)
end
end)
end
As well as these lines for when it calls to send the chat message
RegisterServerEvent('menu:id')
AddEventHandler('menu:id', function(myIdentifiers)
getID(myIdentifiers.steamidentifier, function(data)
if data ~= nil then
TriggerClientEvent("sendProximityMessageID", -1, myIdentifiers.playerid, data.firstname .. " " .. data.lastname .. " " .. data.job)
end
end)
Im looking to add Licenses to one of the menus as well Ill update this with that information once I can get these jobs to display I feel as if I’d have to set up an entierly new fetchall from the user_license table
The Console Responds with this when I try to show ID with the script lines above added
Error running call reference function for resource esx_aiomenu: citizen:/scripting/lua/scheduler.lua:348: server.lua:267: attempt to concatenate a nil value (field 'job')
stack traceback:
server.lua:267: in upvalue 'callback'
server.lua:258: in upvalue 'ref'
citizen:/scripting/lua/scheduler.lua:334: in function <citizen:/scripting/lua/scheduler.lua:333>
[C]: in function 'xpcall'
citizen:/scripting/lua/scheduler.lua:333: in function <citizen:/scripting/lua/scheduler.lua:332>
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/scheduler.lua:348: in function <citizen:/scripting/lua/scheduler.lua:319>
[ERROR] [MySQL] Check the error above, an error happens when executing the callback from the query : "SELECT * FROM `users` WHERE `identifier` = @identifier {=}"