Esx_aiomenu Adding Show Job Show License

help
assistance

#1

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
image
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 {=}"

#2

i was just looking into doing the exact same thing! i was trying to figure out how to have it pull your license from DMV School and display it in the chat or even just have it display with the Show ID maybe like ID:John Smith License=drive or if they dont have a license, License=none. It will be really awesome if you can figure this out, i dont have a lot of coding knowledge, so i dont think i would be able to do it


#3

Well I posted some here, hopefully looking to get a answer back and hopefully a suggestion on how to fix this issue


#4

I got it working, it doesn’t show it what type of license you have I just narrowed it down to one General license called driver’s license. I had to change the license script the DMV School script and the AIO menu


#5

Dude would love for you to make a post on how to do that shit man I am very interested in looking into that Im still having issues


#6

I’d be happy to! I have something to do for the next few hours, but after I’ll for sure try to put something together, I had to modify a few files and make a database alteration, but it wasn’t too hard, was a pain in the ass to figure out, but it won’t he hard with instructions


#7

I’m trying now to make it so when you click 1 button in aiomenu it shows like this [ID] John Smith [LICENSE] Drivers License. Right now I have a license button below the ID button


#8

I was finally able to get it to show the user ID and License on 1 call! I will try to create a tutorial tomorrow, i wanted to get this part down and now that it is, i will share


#9

https://mega.nz/#!VMxkBT4J!yTCFaOCJBvNIQ7lYFr7i4bEcF-ghQqhaKRu1MMFpEy0

the link above is to for a zip file, it contains the replacement files needed for my version of displaying a license type as seen in the screenshots above. it also contains a screenshot showing the required name change to table data for the license table in the database.

let me know if you have any problems using it, my next project is something similar, but with a weapons license


#10

Awesome so when you do show License it does a proximity chat displaying the users license to others. as well as do we just alter All the current “DMV” licenses to “Drivers License”


#11

So after importing everything lol, I seem to have no changes I reset everything to original then reimported it but sadly no luck



#12

did you change the name in the user_license database from “owner” to “identifier”?


#13

No didn’t know if that was specified
Even the Show License Tab isn’t there thats what confused me


#14

i actually removed the show license button and now it all displays together from the show ID button… sorry, probably shouldve have stated that


#15

Scratch that
Lol, I figured out what you mean when it comes to renaming the table


#16

So what happens if you have both weapons and gun license, does it state you have both with a , example [License Type] Weapons, Drivers


#17

not yet, im actually working on that now. hopefully ill have it in the next couple days


#18

Yea, could have data just display there in the field like it does for [[ID]] and stuff
Do we know which ones takes primary over the licenses weapon or driver.


#19

im not sure, i havent messed around with it yet… i have a couple ideas, but im thinking maybe add another column to the user_licenses table for the “sportsmans” license


#20

Hows it looking bro The current one seems to be working fine