Help for add job restriction

Hello my code dont work

require “resources/essentialmode/lib/MySQL”
MySQL:open(“‘-’”, “‘-’”, “root”, “‘-’”)

– HELPER FUNCTIONS

function nameJob(player)
  local executed_query = MySQL:executeQuery("SELECT identifier, job_id, job_name FROM users LEFT JOIN jobs ON jobs.job_id = users.job WHERE users.identifier = '@identifier'", {['@identifier'] = player})
  local result = MySQL:getResults(executed_query, {'job_name'}, "identifier")
  return tostring(result[1].job_name)
end

RegisterServerEvent('BusJOB:success')
AddEventHandler(BusJOB:success', function(price)
print("Player ID " ..source)
TriggerEvent('es:getPlayerFromId', source, function(user)
local nameJob = nameJob(id)
if nameJob == 20 then -- bus job
total = price;
user:addMoney((total))
end)
end)

Could help me to run .-.

We’d need a bit more information than just “it won’t work”.

Do you get an errors in console? If so, could you print them?

Also, does nameJob exist, if so then what does it do?

1 Like

Hello i have more error

Yes the work exists but when I start the server it generates several errors

I sent the error and I posted all my code

Could anyone help? ,-,