Skip to content

Commit

Permalink
chore: es_extended add underflow check for removeAccountMoney
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Jan 13, 2024
1 parent 5ee42de commit 223e465
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,5 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse
68. [bpt_teleport]: chore: update the license file and readme for the year 2024 @bitpredator
69. [bpt_unicornjob]: refactor: bpt_unicornjob inventory implementation @bitpredator
70. [bpt_vehicletax]: chore: bpt_vehicletax update to version 1.0.0 @bitpredator
71. [bpt_wallet]: chore: bpt_wallet update to version 1.0.0 @bitpredator
71. [bpt_wallet]: chore: bpt_wallet update to version 1.0.0 @bitpredator
72. [es_extended]: chore: es_extended add underflow check for removeAccountMoney @bitpredator
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/es_extended/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2022-2023 bitpredator
Copyright (C) 2022-2024 bitpredator

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

<program> Copyright (C) 2022-2023 bitpredator
<program> Copyright (C) 2022-2024 bitpredator
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ function ESX.Game.GetVehicleProperties(vehicle)
if customXenonColorR and customXenonColorG and customXenonColorB then
customXenonColor = {customXenonColorR, customXenonColorG, customXenonColorB}
end

local hasCustomSecondaryColor = GetIsVehicleSecondaryColourCustom(vehicle)
local customSecondaryColor = nil
if hasCustomSecondaryColor then
Expand Down
2 changes: 1 addition & 1 deletion server-data/resources/[esx]/es_extended/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ game 'gta5'
description 'ES Extended'

lua54 'yes'
version '0.0.4'
version '1.0.0'

shared_scripts {
'locale.lua',
Expand Down
2 changes: 1 addition & 1 deletion server-data/resources/[esx]/es_extended/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ add_ace resource.es_extended command.stop allow

es_extended - ESX framework for FiveM

Copyright (C) 2015-2023 Jérémie N'gadi - Rework by bitpredator
Copyright (C) 2015-2024 Jérémie N'gadi - Rework by bitpredator
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,

if account then
money = account.round and ESX.Math.Round(money) or money
if self.accounts[account.index].money - money > self.accounts[account.index].money then
print(('[^1ERROR^7] Tried To Underflow Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId))
return
end
self.accounts[account.index].money = self.accounts[account.index].money - money

self.triggerEvent('esx:setAccountMoney', account)
Expand Down
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/es_extended/server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)

Core.RegisteredCommands[name] = {group = group, cb = cb, allowConsole = allowConsole, suggestion = suggestion}

RegisterCommand(name, function(playerId, args, _)
RegisterCommand(name, function(playerId, args)
local command = Core.RegisteredCommands[name]

if not command.allowConsole and playerId == 0 then
Expand Down Expand Up @@ -167,7 +167,7 @@ function ESX.RegisterServerCallback(name, cb)
Core.ServerCallbacks[name] = cb
end

function ESX.TriggerServerCallback(name, _, source,Invoke, cb, ...)
function ESX.TriggerServerCallback(name, _, source, Invoke, cb, ...)
if Core.ServerCallbacks[name] then
Core.ServerCallbacks[name](source, cb, ...)
else
Expand Down

0 comments on commit 223e465

Please sign in to comment.