The replacement for this resource is currently available in beta:
Hey, Mobius01
How would it be possible to add money from a certain level? I tried for the weapons it works very well but impossible for the money or the items do you have an idea?
Thank you in advance good end of the day.
(sorry for my english)
I have a pet shop then how do other players have to go to a certain level to buy the pet?
Working in ES_EXTENDED 1.1?
Halo…do you fix it?
Halo…I want to disable punch and fire key…when player level 5 then player can punch and firing…
Can help me?
Give you a suggestion, hope to help you. This is one of the methods I designed, try to add in your script to function it. And of course, you can follow the method provided by the author, because it has already explained in detail how to use it, but I choose my own method, so I can give you a reference here.
Client:
ESX.TriggerServerCallback('esx_xp:checklevel', function(level)
if level >= 5 then
--Do something if the player has reached level 5
else
ESX.ShowNotification("Insufficient level")
end
end)
Server:
ESX.RegisterServerCallback('esx_xp:checklevel', function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', {
['@identifier'] = xPlayer.identifier
}, function(result)
if #result > 0 then
local CurrentRank = tonumber(result[1]["rp_rank"])
cb(CurrentRank)
end
end)
end)
bro i am not able to connect to server why can please tell me the solution.
When I gain xp or add with command it doesn’t save in db solution?
If you guys want to add an check rank system with limit, use this, all client sided
setlimitforuser = true
Citizen.CreateThread(function()
Wait(50)
local XPrank = exports.esx_xp:ESXP_GetRank()
if XPrank >= 3 then
setlimitforuser = false
end
end)
Citizen.CreateThread(function()
local player = GetPlayerPed(-1)
while setlimitforuser do
Wait(50)
DisableControlAction(2, 37)
DisablePlayerFiring(player)
DisableControlAction(0, 140)
DisableControlAction(0, 106)
end
end)
not work for me
Could you send me the file that you are adding this code on it?
in client side of es_extended didnt work
and i try in client side of esx_xp didnt work too
create a folder called esx_xpLimits
create a file inside it called client.lua
paste this code on it:
setlimitforuser = true
Citizen.CreateThread(function()
Wait(50)
local XPrank = exports.esx_xp:ESXP_GetRank()
if XPrank >= 3 then
setlimitforuser = false
end
end)
Citizen.CreateThread(function()
local player = GetPlayerPed(-1)
while setlimitforuser do
Wait(50)
DisableControlAction(2, 37)
DisablePlayerFiring(player)
DisableControlAction(0, 140)
DisableControlAction(0, 106)
end
end)
then create a file called __resource.lua
and add this code on it:
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
client_script 'client.lua'
Now start this resource on your server.cfg !!
still cant, when the player level up. the player still cant punch or firing
Because that snippet only checks the rank once and will fail if the player’s rank changes. Try this instead:
-- client.lua
local setlimitforuser = true
Citizen.CreateThread(function()
while true do
-- Periodically check the player's rank
local XPrank = exports.esx_xp:ESXP_GetRank()
setlimitforuser = XPrank < 3
Wait(1000)
end
end)
Citizen.CreateThread(function()
local player = PlayerPedId()
while true do
Wait(0)
if setlimitforuser then
DisablePlayerFiring(player)
DisableControlAction(2, 37)
DisableControlAction(0, 140)
DisableControlAction(0, 106)
else
Wait(1000) -- sleep
end
end
end)
then create a file called __resource.lua
Don’t do this! __resource.lua
is deprecated - use fxmanifest.lua
instead:
fx_version 'cerulean'
game 'gta5'
client_script 'client.lua'
Why do people insist on using GetPlayerPed(-1)
instead of the faster PlayerPedId()
?
Thanks, thats the right code i guess,
I do use GetPlayerPed(-1) because i dont know what is the difference between this and PlayerPedId()
PlayerPedId()
is much faster.
anyway, how to add exp to serverside and update in client side when doing some job
iam using this after addinventoryitem
TriggerClientEvent(‘esx_xp:Add’, xPlayer, 200)
but nothing happen.
snippet
if transformQuantity >= 100 then
TriggerClientEvent('esx:showNotification', _source, _U('too_many_pouches'))
TriggerClientEvent('esx_drugs:unfreeze', _source)
elseif itemQuantity < v.QToProcess then
TriggerClientEvent('esx:showNotification', _source, _U('not_enough', drug))
TriggerClientEvent('esx_drugs:unfreeze', _source)
else
if xPlayer.canCarryItem(v.Item, jmlh) then
xPlayer.removeInventoryItem(v.Item, v.QToProcess, 888)
xPlayer.addInventoryItem(v.ItemTransform, 5, 888)
Transform(_source, drug)
TriggerClientEvent('esx_xp:Add', xPlayer, 200)
end
end
How do I lock a weapon / vehicle / unlockable to a rank in database value not variable in code ?