account type for qb format to esx
This commit is contained in:
1 parent
9863393775
commit
3e6bc0dd81
1 file changed
+3
-2
@@ -243,6 +243,7 @@ end
|
|||||||
Framework.AddAccountBalance = function(src, _type, amount)
|
Framework.AddAccountBalance = function(src, _type, amount)
|
||||||
local xPlayer = ESX.GetPlayerFromId(src)
|
local xPlayer = ESX.GetPlayerFromId(src)
|
||||||
if not xPlayer then return end
|
if not xPlayer then return end
|
||||||
|
if _type == 'cash' then _type = 'money' end
|
||||||
return xPlayer.addAccountMoney(_type, amount)
|
return xPlayer.addAccountMoney(_type, amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -251,6 +252,7 @@ end
|
|||||||
Framework.RemoveAccountBalance = function(src, _type, amount)
|
Framework.RemoveAccountBalance = function(src, _type, amount)
|
||||||
local xPlayer = ESX.GetPlayerFromId(src)
|
local xPlayer = ESX.GetPlayerFromId(src)
|
||||||
if not xPlayer then return end
|
if not xPlayer then return end
|
||||||
|
if _type == 'cash' then _type = 'money' end
|
||||||
xPlayer.removeAccountMoney(_type, amount)
|
xPlayer.removeAccountMoney(_type, amount)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -260,6 +262,7 @@ end
|
|||||||
Framework.GetAccountBalance = function(src, _type)
|
Framework.GetAccountBalance = function(src, _type)
|
||||||
local xPlayer = ESX.GetPlayerFromId(src)
|
local xPlayer = ESX.GetPlayerFromId(src)
|
||||||
if not xPlayer then return end
|
if not xPlayer then return end
|
||||||
|
if _type == 'cash' then _type = 'money' end
|
||||||
return xPlayer.getAccount(_type).money
|
return xPlayer.getAccount(_type).money
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -331,5 +334,3 @@ Framework.Commands.Add = function(name, help, arguments, argsrequired, callback,
|
|||||||
arguments = arguments
|
arguments = arguments
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- test
|
|
||||||
Reference in new issue
Block a user