Paycheck distance - Release

HELLO THIS IS A SIMPLE PAYCHECK DISTANCE FOR ESX

PREWIEW

YOU CAN FIND THE CODE HERE: GitHub - Koia124/paycheck_distance: This FiveM script is a simple paycheck distance system for ESX Framework

Code is accessible Yes
Subscription-based No
Lines (approximately) 37
Requirements es_extended
Support No
2 Likes

wow a paycheck system that

  • exposes a paycheck event to the network, allowing clients to request their salary at any arbitrary moment
  • handles the paycheck interval on the client for ultimate meme
  • requires you to be standing in predefined location to get paid when the interval runs
  • uses stupid esx event loop
  • uses even more of the worst practices from the era of esx 1.1

all that and more in just 37 lines and all for freeeeeeeeee

6 Likes

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

10 Modders Like your Script xD

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.

1 Like

OK thank you
really much for the suggestion that can help me better understand fivem’s lua!

cheaters/modders are happy now :rofl:

this is literally his first post i know you all can see that no need to act like an ass. Just give respectful critism.

2 Likes

You didnt understand the sense of the script. Go fucking read that lines
And solve all the ox inventory problems, thanks.

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

Because vectors are bad mkay?

Anything else?

  • 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?

Just because you make me mad

For all who want use a secure way to do this useless shitty paycheck distance thing

Code contains various bad practices around trusting the client

But the real question is who asked you?

Wow Amazing Aribo Scripts ! GG Dude