GetAccountBalace (client) fixed for esx
This will return the players money by type, I recommend not using this as its the client and not secure or to be trusted. Use case is for a ui or a menu I guess?
This commit is contained in:
1 parent
ebdaf5be94
commit
395629af17
3 files changed
+10
-3
No files matched your search
@@ -131,15 +131,20 @@ Framework.GetPlayerInventory = function()
|
||||
end
|
||||
|
||||
---This will return the players money by type, I recommend not useing this as its the client and not secure or to be trusted.
|
||||
---UNTESTED ON ESX (Should work?)
|
||||
---Use case is for a ui or a menu I guess.
|
||||
---@param _type string
|
||||
---@return number
|
||||
Framework.GetAccountBalance = function(_type)
|
||||
local player = Framework.GetPlayerData()
|
||||
if not player then return 0 end
|
||||
local account = player.accounts
|
||||
local accounts = player.accounts
|
||||
if _type == 'cash' then _type = 'money' end
|
||||
return account[_type].money or 0
|
||||
for _, account in ipairs(accounts) do
|
||||
if account.name == _type then
|
||||
return account.money or 0
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
---This will return the vehicle properties for the specified vehicle.
|
||||
|
||||
Reference in new issue
Block a user