Hello Linden the script doesn’t trigger when you stand still in a specific position, but when you stay in the range of the position and in any case thanks for the advice even if you could save yourself from taking the piss out of me
Joking aside. The script is very much in need of optimization. You don’t even need to query the job from the server side, esx already has that on the client side. You can also move the whole thing to the server.
As a tip: Players go into the service, the server starts a loop and every 5 minutes or so the server checks if the person is still in the range.
If you think this resource isn’t problematic you’re braindead. But this is FiveM so hey, go run this on your (I’m sure very amazing) server.
And solve all the ox inventory problems, thanks.
Feel free to report the issues you have in an appropriate location or go and shove a fist up your arse, you turd muncher.
What do you even mean I “didnt understand the sense of the script”? I pointed out exactly what’s wrong with it.
ESX.RegisterServerCallback("paycheck:paycheck", function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer then
local salary = xPlayer.job.grade_salary
cb(salary)
xPlayer.addAccountMoney('bank', salary)
end
end)
Same energy as esx_pizzapay. Code isn’t magically secured by using server callbacks; why would anyone remove the server-side handled payment system to use this?
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
Doesn’t even work on the latest ESX.
local playerPos = GetEntityCoords(player)
Where is player defined…?
if GetDistanceBetweenCoords(job.pos, GetEntityCoords(PlayerPedId())) <= job.dist then
Deprecated methods. Make sure your release does not contain deprecated methods, such as creating chat commands without the REGISTER_COMMAND native.
Few Lines. Releases with minimal code (such as only one script file that contains less than 50 lines) are considered too simple and is not allowed. We want users to release meaningful, configurable and complete scripts. Everyone starts somewhere, but not every little script you create needs to be shared.
Good code. Please try to optimize your code as much as possible. When creating threads/loops, think twice before putting a lot of code into it. Code that gets executed every tick is usually bad. Try to keep this to a minimum and add sufficient delays wherever possible. There’s a great topic by @Syntasu on how to improve performance, take a look at that topic here: [Best practice] Improve your resource performance
Remember that the quality of your release impacts your image in the FiveM community. Take your time when releasing a resource.
Are these guidelines no longer being adhered to or something?