[ESX] Check Job ID external

roleplay
async
essentialmode
fxserver
es_extended

#1

Hi everyone!

First of all many thanks to readers that are releasing scripts ect! I really appreciate! And my English grammar is really bad.

I have an working server already, with ES Extended and **Essentialmode ** v4.9.*! Everything is working its nothing like questions about setting up things.

It an job from the earlier jobs-system! Like for now i have the money and everyhing working!You recieve money, and ect ect!

Except that is it checking the job of the player!

**For example **

if job name is == or =~ ESX … ( tried allot of looking in released jobs )

triggerserverevent or in client to start the job

else

triggerevent to show the player that he has not the job.

This coding above is ofcourse like as axample!

Who knows where it is , i searched but couldnt find it my self! Or can help right away!

Check the image i will send with it! I have implemented the ESX also ofcourse in the __resources i have the @/mysql-async ect ect ect.

Friendly regards!
TheUnkown / SkyLake


#2

Post it in the correct category next time please.


#3

I’m confused as to the purpose of this thread… Are you asking for help with this?


#4

If you are using the Essential Mode, then ask for help here: https://forum.fivem.net/t/release-essentialmode-base/3665

And better bring a translator, because I don’t think anyone is going to understand what you are saying.


#5

this is not how u fetch items from a mysql database anymore

this is how esx_identity does it

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]['firstname'] ~= nil then
      local data = {
        identifier  = result[1]['identifier'],
        firstname  = result[1]['firstname'],
        lastname  = result[1]['lastname'],
        dateofbirth  = result[1]['dateofbirth'],
        sex      = result[1]['sex'],
        height    = result[1]['height']
      }

      callback(data)
    else
      local data = {
        identifier   = '',
        firstname   = '',
        lastname   = '',
        dateofbirth = '',
        sex     = '',
        height     = ''
      }

      callback(data)
    end
  end)
end

#6

Right! I fixed it!

I know that there was an difference, about the fetching but coulnt really find an thing for me that was making sense! ( for me ) I’m hosting many servers but .lua is new for me so im reading and trying to understand haha!

But i’m having an new server, and was trying to put some jobs in from CFX Server i had previously!

Anyway! Thanks in advanced!


#7

Well i’m sorry, maybe i wasn’t really clear enough! Yes i was asking the solution becouse before it was like checking players job!

But thanks anyway for looking in!

Ciao