mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
Merge branch 'dev' into feature/funk
# Conflicts: # frontend/src/config/apps.test.ts # frontend/src/config/apps.ts # frontend/src/stores/phone.ts # frontend/testserver/index.cjs # sky_phone/config/locales/en.lua # sky_phone/source/html/index.html # sky_phone/source/server/db_migrate.lua
This commit is contained in:
@@ -21,6 +21,46 @@ function Bridge.Framework.GetIdentifier(source)
|
||||
return player and player.identifier or nil
|
||||
end
|
||||
|
||||
function Bridge.Framework.GetMoney(source, account)
|
||||
local player = get_player(source)
|
||||
if not player then
|
||||
return nil
|
||||
end
|
||||
if account == "cash" then
|
||||
account = "money"
|
||||
end
|
||||
local account_data = player.getAccount(account)
|
||||
return account_data and account_data.money or nil
|
||||
end
|
||||
|
||||
function Bridge.Framework.AddMoney(source, account, amount)
|
||||
local player = get_player(source)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
if account == "cash" then
|
||||
account = "money"
|
||||
end
|
||||
player.addAccountMoney(account, amount)
|
||||
return true
|
||||
end
|
||||
|
||||
function Bridge.Framework.RemoveMoney(source, account, amount)
|
||||
local player = get_player(source)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
if account == "cash" then
|
||||
account = "money"
|
||||
end
|
||||
local account_data = player.getAccount(account)
|
||||
if not account_data or account_data.money < amount then
|
||||
return false
|
||||
end
|
||||
player.removeAccountMoney(account, amount)
|
||||
return true
|
||||
end
|
||||
|
||||
function Bridge.Framework.GetFirstname(source)
|
||||
local player = get_player(source)
|
||||
return player and player.get("firstName") or nil
|
||||
|
||||
@@ -21,6 +21,27 @@ function Bridge.Framework.GetIdentifier(source)
|
||||
return player and player.PlayerData and tostring(player.PlayerData.citizenid) or nil
|
||||
end
|
||||
|
||||
function Bridge.Framework.GetMoney(source, account)
|
||||
local player = get_player(source)
|
||||
return player and player.PlayerData and player.PlayerData.money[account] or nil
|
||||
end
|
||||
|
||||
function Bridge.Framework.AddMoney(source, account, amount)
|
||||
local player = get_player(source)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
return player.Functions.AddMoney(account, amount)
|
||||
end
|
||||
|
||||
function Bridge.Framework.RemoveMoney(source, account, amount)
|
||||
local player = get_player(source)
|
||||
if not player or not player.PlayerData.money[account] or player.PlayerData.money[account] < amount then
|
||||
return false
|
||||
end
|
||||
return player.Functions.RemoveMoney(account, amount)
|
||||
end
|
||||
|
||||
local function get_character_info(source)
|
||||
local player = get_player(source)
|
||||
return player and player.PlayerData and player.PlayerData.charinfo or nil
|
||||
|
||||
@@ -19,6 +19,18 @@ function Bridge.Framework.GetIdentifier(source)
|
||||
return player and player.PlayerData and tostring(player.PlayerData.citizenid) or nil
|
||||
end
|
||||
|
||||
function Bridge.Framework.GetMoney(source, account)
|
||||
return exports.qbx_core:GetMoney(tonumber(source), account)
|
||||
end
|
||||
|
||||
function Bridge.Framework.AddMoney(source, account, amount)
|
||||
return exports.qbx_core:AddMoney(tonumber(source), account, amount)
|
||||
end
|
||||
|
||||
function Bridge.Framework.RemoveMoney(source, account, amount)
|
||||
return exports.qbx_core:RemoveMoney(tonumber(source), account, amount)
|
||||
end
|
||||
|
||||
local function get_character_info(source)
|
||||
local player = get_player(source)
|
||||
return player and player.PlayerData and player.PlayerData.charinfo or nil
|
||||
|
||||
Reference in New Issue
Block a user