esx_xp icon indicating copy to clipboard operation
esx_xp copied to clipboard

XP Bar / Leaderboard not opening pressing (Z)

Open kamuzaki opened this issue 5 years ago • 10 comments
trafficstars

Hi there, Really good job you've done and thanks.. I just download your resource, install it and when i press Z to open the XP bar doesn't open and printing this error in server console, any ideas/help? https://prntscr.com/v7gngm

kamuzaki avatar Oct 26 '20 23:10 kamuzaki

Check to see if the users table has the license column.

Mobius1 avatar Oct 27 '20 09:10 Mobius1

Hi, thanks for your response No it doesn't.. FiveM License is under Identifier column.. I'm using es_extended V1 final.. Do I have to create a column named license? Does you script auto generate licences and store them in DB under license column?

kamuzaki avatar Oct 27 '20 10:10 kamuzaki

Download the latest version from here. I've added a check to see if the license column exists, if it doesn't, it uses the identifier instead.

Mobius1 avatar Oct 27 '20 10:10 Mobius1

You're a legend! Thank you.. I'll give it a go when I go home at work atm.. I'll let you know if its all OK around 7:00 UK time..

kamuzaki avatar Oct 27 '20 10:10 kamuzaki

hi, it did fix the problem (i van open the bar with Z) but not showing online players https://prnt.sc/v86iqh

kamuzaki avatar Oct 27 '20 20:10 kamuzaki

Hi mate can you plz tell why doesn't showing online players in leaderboard?

kamuzaki avatar Nov 10 '20 13:11 kamuzaki

still doesnt worek

SwAtRaNgEr avatar Dec 14 '20 10:12 SwAtRaNgEr

still doesnt worek

Hi is this a question? For me? If so, yes still doesn't work. Still showing 0 online players..

kamuzaki avatar Jan 29 '21 19:01 kamuzaki

Download the latest version from here. I've added a check to see if the license column exists, if it doesn't, it uses the identifier instead.

Doesn't appear to work for servers with multi-char systems that do not modify the identifier. For example Kashchars modifies the identifier each time a player joins and selects their char.

There are some scripts that keep them static but have an additional integer example: 1:steam:XXX, 2:steam:XXX and it stays like that even if a person selects their character.

ScaredDonut avatar May 31 '21 17:05 ScaredDonut

Managed to "half" fix it so far. No errors and the ID's match according to my little debug, but "Z" is not triggering (doesn't show leaderboard or your level) and the /EXSP command does not return correct values.

`ESX = nil

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

-- Get Identifier function GetPlayerLicense(id) xPlayer = ESX.GetPlayerFromId(id)

if xPlayer and xPlayer ~= nil then
    return xPlayer.identifier
end

return false

end

function GetOnlinePlayers(_source, players) local Active = {}

for _, playerId in ipairs(GetPlayers()) do
    local name = GetPlayerName(playerId)
    local license = GetPlayerLicense(playerId)

    for k, v in pairs(players) do
        print(v.identifier .. "/" .. license)
		print()
		if license == v.license or license == v.identifier then
		
            local Player = {
                name = name,
                id = playerId,
                xp = v.rp_xp,
                rank = v.rp_rank
            }

            -- Current player
            if GetPlayerLicense(_source) == license then
                Player.current = true
            end
                        
            if Config.Leaderboard.ShowPing then
                Player.ping = GetPlayerPing(playerId)
            end

            table.insert(Active, Player)
            break
        end
    end
end
return Active 

end`

This is what the debug returns: [ script:esx_xp] 1:steam:11000010495713d/1:steam:11000010495713d

Anyone got any other ideas? I am out of them right now.

Edit: That fixed it, just restart your server

ScaredDonut avatar Jun 01 '21 03:06 ScaredDonut