Skip to content

Commit

Permalink
let people go negative to fix certain exploits
Browse files Browse the repository at this point in the history
This allows people to go negative to fix 1 of the 2 main methods for duplicating money in DarkRP

by default, darkrp doesn't seem to set the "wallet" column to unsigned anywhere so no need to alter tables
I also confirmed I was able to do the following w/o having my money reset:
- leave & immediately rejoin
- restart the server w/o leaving (via _restart specifically)
- leave then restart the server
  • Loading branch information
lionbryce committed Dec 31, 2023
1 parent 7287eec commit e468f15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gamemode/modules/base/sv_data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ function DarkRP.createPlayerData(ply, name, wallet, salary)
end

function DarkRP.storeMoney(ply, amount)
if not isnumber(amount) or amount < 0 or amount >= 1 / 0 then return end
if not isnumber(amount) or amount >= 1 / 0 then return end

-- Also keep deprecated UniqueID data at least somewhat up to date
MySQLite.query([[UPDATE darkrp_player SET wallet = ]] .. amount .. [[ WHERE uid = ]] .. ply:UniqueID() .. [[ OR uid = ]] .. ply:SteamID64())
Expand Down

0 comments on commit e468f15

Please sign in to comment.