[RELEASE][ESX] esx_xp

How to setup this script with esx_vehicleshop ?

wehere paste this? in esx_xp server? or client?

Hey how to coding giving player 100xp every 10 minutes?

they are few option above this topic, 1 in client side and 1 in server side and both is working u can choose either one of those

This is for server side u can put on your server.lua

This is for client side u can put on client.lua

Please choose only 1 either server or client, u cant put both together cos its same function

I do not know if it happens to someone else but some players are reporting that on certain occasions it does not load the level correctly. I already created an issue on github but maybe it happened to one of them and could solve it.

Im looking for the same thing any luck???

I will start to run through to see the problem and let you know the fix as soon as I find out as I have not ever had this issue myself may.

1 Like

You can set events so say when client reaches rp_rank 20 they get a boost of say 5000 xp. Or you could use it so at certain levels they would unlock weapon categories and vehicle categories.

1 Like

Thank you very match. I asked several users and none of them could give me any useful information about what is going on. No error appears in F8. The only thing I have modified in the script were the names of the functions but I don’t think I have altered anything.

Thank you for the reply! Im trying to do something like they receive a vehicle when reach a level. Figuring out how to give car to that person without them claiming it from vehiclehsop.

Hi, I had a problem with this code

function UpdateXPToPlayer(_xp, _playerId, init)
    _xp = tonumber(_xp)
    print(_playerId)
    player = ESX.GetPlayerData(_playerId)
    _currentXP = player.xp
    local points = _currentXP + _xp
    local max = ESXP_GetMaxXP()

    if init then
        points = _xp
    end

    points = LimitXP(points)

    local rank = ESXP_GetRank(points)
    print("puntos: ".. points .. " rank: ".. rank .. " currentxp: ".._currentXP)
    TriggerServerEvent("esx_xp:setXP", points, rank, _playerId)
end

And this TriggerServerEvent don’t work, i don’t know why. Can someone help me?
Thanks.

I’ve tried

AddEventHandler(“esx_xp:rankUp”, function(newRank, previousRank)
if newRank == 10 then
TriggerClientEvent(“esx_vehicleshop:claimCar”, source)
end
end)

But its not doing anything when player level up.

I’m overhauling this mod to make locking stuff to a rank much easier for everyone. Stay tuned for the next release.

3 Likes

How can I do to get exp by killing a player?

Hello Mobius sometimes my players get XP resetted to rank 1 and 100 exp, what can be causing this?

1 Like

im having the same problem too, i feel its from server delay. Im just waiting for the next release from Mobius now.

im just using the old XNLRankBar instead of this right now, maybe it can be a tempfix for you too :slight_smile:

it’s working fine , but it’s never appears on the screen why ?

how to config with add xp with every 10 min to player
(For played 10min)

function ShowJobListingMenu(data)
ESX.TriggerServerCallback(‘esx_joblisting:getJobsList’, function(data)
local elements = {}
for i = 1, #data, 1 do
table.insert(
elements,
{label = data[i].label, value = data[i].value}
)
end

	ESX.UI.Menu.CloseAll()

	ESX.UI.Menu.Open(
		'default', GetCurrentResourceName(), 'joblisting',
		{
			title    = _U('job_center'),
			align = "top-right",
			elements = elements
		},
		function(data, menu)
			TriggerServerEvent('esx_joblisting:setJob', data.current.value)
			ESX.ShowNotification(_U('new_job'))
			menu.close()
		end,
		function(data, menu)
			menu.close()
		end
	)

end)

end

how to lock jobs with xp?