formatted code block

This commit is contained in:
SamShanks1
2022-07-30 18:01:39 +01:00
parent 7e791665d7
commit cd9c125711

View File

@@ -15,10 +15,9 @@ of PEFCL and QBCore installed**
- Under `target` - Under `target`
- `type`: `"qb-target"` - `type`: `"qb-target"`
- `enabled`: `true` - `enabled`: `true`
4. Navigate to `qb-core\server\player.lua` and replace those functions: 4. Navigate to `qb-core\server\player.lua` and replace those functions:
- self.Functions.AddMoney => - self.Functions.AddMoney =>
``` ```lua
function self.Functions.AddMoney(moneytype, amount, reason) function self.Functions.AddMoney(moneytype, amount, reason)
reason = reason or 'unknown' reason = reason or 'unknown'
moneytype = moneytype:lower() moneytype = moneytype:lower()
@@ -48,7 +47,8 @@ of PEFCL and QBCore installed**
end end
``` ```
- self.Functions.RemoveMoney => - self.Functions.RemoveMoney =>
``` ```lua
function self.Functions.RemoveMoney(moneytype, amount, reason)
reason = reason or 'unknown' reason = reason or 'unknown'
moneytype = moneytype:lower() moneytype = moneytype:lower()
amount = tonumber(amount) amount = tonumber(amount)
@@ -89,9 +89,10 @@ of PEFCL and QBCore installed**
end end
return true return true
end
``` ```
- self.Functions.SetMoney - self.Functions.SetMoney
``` ```lua
function self.Functions.SetMoney(moneytype, amount, reason) function self.Functions.SetMoney(moneytype, amount, reason)
reason = reason or 'unknown' reason = reason or 'unknown'
moneytype = moneytype:lower() moneytype = moneytype:lower()
@@ -117,12 +118,12 @@ of PEFCL and QBCore installed**
end end
``` ```
- self.Functions.GetMoney - self.Functions.GetMoney
``` ```lua
function self.Functions.GetMoney(moneytype) function self.Functions.GetMoney(moneytype)
if not moneytype then return false end if not moneytype then return false end
moneytype = moneytype:lower() moneytype = moneytype:lower()
if moneytype == 'bank' then if moneytype == 'bank' then
self.PlayerData.money[moneytype] = exports.pefcl:getDefaultAccountBalance(self.PlayerData.source).data or 0 self.PlayerData.money[moneytype] = exports.pefcl:getDefaultAccountBalance(self.PlayerData.source).data or 0
return exports.pefcl:getDefaultAccountBalance(self.PlayerData.source).data return exports.pefcl:getDefaultAccountBalance(self.PlayerData.source).data
end end
return self.PlayerData.money[moneytype] return self.PlayerData.money[moneytype]