swkeep / keep-containers

qbcore esx sotrage container
GNU General Public License v3.0
83 stars 21 forks source link

Cant find job on esx legacy? #9

Open SuperRustly opened 1 year ago

SuperRustly commented 1 year ago

it cant find an job on client 51

anes66 commented 1 year ago

same problem here

bert1475 commented 9 months ago

Hi i have a solution to your problem!! Go to your client.lua and replace the

function GetJob()
    local PlayerData = PlayerData()
    if Framework == 1 then
        return PlayerData.job.name ,PlayerData.job.grade.level
    elseif Framework == 2 then
        return PlayerData.job.name, PlayerData.job.grade
    end
end

with

function GetJob()
    local Player = PlayerData() 
    if not Player or not Player.job then
        return nil, nil 
    end

    if Framework == 1 then
        return Player.job.name, Player.job.grade.level
    elseif Framework == 2 then
        return Player.job.name, Player.job.grade
    else
        return nil, nil 
    end
end

then it should work