Help in esx invest

I’ve been tring to take the esx_invest code and create a stoke broker job.
so only if you have that job name in the data base the event of open the invest menu will happend
this is what i came up with but it is not working.

Citizen.CreateThread(function()

local jobinv = ESX.GetPlayerData().job

while true do

    Citizen.Wait(0)

    if jobinv == investor then

        if near() then

            Notify(_U("open_menu"))

            if IsControlJustPressed(1, keys[Config.Keys.Open]) then

                openUI()

                local ped = GetPlayerPed(-1)

                TriggerServerEvent("invest:balance")

            end



            if IsControlJustPressed(1, keys[Config.Keys.Close]) and inMenu then

                closeUI()

            end

        end

    end

end     

end)

thx to all helpers

anyone ?

help please!

tried to add this fuction

AddEventHandler(‘esx:setJob’, function(job)
PlayerJob = job.name

end)

– User Interaction

Citizen.CreateThread(function()

while true do

    Citizen.Wait(0)

    if PlayerJob == investor then

        if near() then

            Notify(_U("open_menu"))

            if IsControlJustPressed(1, keys[Config.Keys.Open]) then

                openUI()

                local ped = GetPlayerPed(-1)

                TriggerServerEvent("invest:balance")

            end



            if IsControlJustPressed(1, keys[Config.Keys.Close]) and inMenu then

                closeUI()

            end

        end

    end

end     

end)

didnt work

RegisterCommand(“get”, function(source, args)

local jobString = table.concat(args, " ")

MySQL.Async.fetchAll("SELECT job FROM users",{}, 

function(result)

        TriggerClientEvent("output", source, "^3("..result[1].job ..)  

end)    

end)

been tring diffrent codes still not working

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.