housing und dj
This commit is contained in:
parent
112c7b1761
commit
10a5d168d4
731 changed files with 506993 additions and 0 deletions
255
resources/[housing]/qs-housing/server/custom/framework/esx.lua
Normal file
255
resources/[housing]/qs-housing/server/custom/framework/esx.lua
Normal file
|
@ -0,0 +1,255 @@
|
|||
if Config.Framework ~= 'esx' then
|
||||
return
|
||||
end
|
||||
|
||||
userTable = 'users' -- users
|
||||
identifierColumn = 'identifier' -- identifier
|
||||
accountsColumn = 'accounts'
|
||||
|
||||
ESX = exports['es_extended']:getSharedObject()
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded', function(id, data)
|
||||
Wait(2000)
|
||||
Debug('Loaded player:', id)
|
||||
CreateQuests(id)
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
for k, v in pairs(ESX.Players) do
|
||||
if v and v.source then
|
||||
Debug('Loaded player:', v.source)
|
||||
CreateQuests(v.source)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function RegisterServerCallback(name, cb)
|
||||
ESX.RegisterServerCallback(name, cb)
|
||||
end
|
||||
|
||||
function RegisterUsableItem(name, cb)
|
||||
ESX.RegisterUsableItem(name, cb)
|
||||
end
|
||||
|
||||
function GetPlayerFromId(source)
|
||||
return ESX.GetPlayerFromId(source)
|
||||
end
|
||||
|
||||
function GetPlayerFromIdentifier(identifier)
|
||||
return ESX.GetPlayerFromIdentifier(identifier)
|
||||
end
|
||||
|
||||
function PlayerIsAdmin(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
return player.getGroup() == 'admin' or player.getGroup() == 'superadmin'
|
||||
end
|
||||
|
||||
function AddMoneyToAccount(account, amount, isNotRent)
|
||||
local source = GetPlayerSourceFromIdentifier(account)
|
||||
if source then
|
||||
AddAccountMoney(source, 'bank', amount)
|
||||
if isNotRent then return end
|
||||
TriggerClientEvent('qb-houses:sendTextMessage', source, Lang('HOUSING_NOTIFICATION_RENT_PAYMENT') .. amount, 'error')
|
||||
else
|
||||
local result = MySQL.Sync.fetchAll('SELECT accounts FROM users WHERE identifier = ?', { account })
|
||||
if not result[1] then return print('Add Money Account : Not finded this account: ' .. account) end
|
||||
local accounts = json.decode(result[1].accounts)
|
||||
accounts.bank = accounts.bank + amount
|
||||
MySQL.Sync.execute('UPDATE users SET accounts = ? WHERE identifier = ?', {
|
||||
json.encode(accounts),
|
||||
account
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function RemoveMoneyFromAccount(account, amount, dontCheck)
|
||||
local source = GetPlayerSourceFromIdentifier(account)
|
||||
if source then
|
||||
RemoveAccountMoney(source, 'bank', amount)
|
||||
return true
|
||||
else
|
||||
local player = MySQL.Sync.fetchAll('SELECT accounts FROM users WHERE identifier = ?', { account })
|
||||
if player[1] then
|
||||
local accounts = json.decode(player[1].accounts)
|
||||
if accounts.bank >= amount or dontCheck then
|
||||
accounts.bank = accounts.bank - amount
|
||||
MySQL.Sync.execute('UPDATE users SET accounts = ? WHERE identifier = ?', { json.encode(accounts), account })
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function GetJobName(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
if not player then return '' end
|
||||
return player.getJob().name
|
||||
end
|
||||
|
||||
function GetCharacterName(source)
|
||||
local xPlayer = GetPlayerFromId(source)
|
||||
local firstName, lastName
|
||||
if xPlayer.get and xPlayer.get('firstName') and xPlayer.get('lastName') then
|
||||
firstName = xPlayer.get('firstName')
|
||||
lastName = xPlayer.get('lastName')
|
||||
else
|
||||
local name = MySQL.Sync.fetchAll('SELECT `firstname`, `lastname` FROM `users` WHERE `identifier`=@identifier', { ['@identifier'] = ESX.GetIdentifier(source) })
|
||||
firstName, lastName = name[1]?.firstname or ESX.GetPlayerName(source), name[1]?.lastname or ''
|
||||
end
|
||||
|
||||
return firstName, lastName
|
||||
end
|
||||
|
||||
function GetAccountMoney(source, account)
|
||||
local player = GetPlayerFromId(source)
|
||||
return player.getAccount(account).money
|
||||
end
|
||||
|
||||
function AddAccountMoney(source, account, amount)
|
||||
local player = GetPlayerFromId(source)
|
||||
player.addAccountMoney(account, amount)
|
||||
end
|
||||
|
||||
function RemoveAccountMoney(source, account, amount)
|
||||
local player = GetPlayerFromId(source)
|
||||
player.removeAccountMoney(account, amount)
|
||||
end
|
||||
|
||||
function RemoveItem(source, item, count)
|
||||
local player = GetPlayerFromId(source)
|
||||
player.removeInventoryItem(item, count)
|
||||
end
|
||||
|
||||
function GetIdentifier(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
return player.identifier
|
||||
end
|
||||
|
||||
function GetPlayerSourceFromIdentifier(identifier)
|
||||
local player = GetPlayerFromIdentifier(identifier)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
return player.source
|
||||
end
|
||||
|
||||
function GetPlayerSourceFromSource(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
return player.source
|
||||
end
|
||||
|
||||
function GetCharacterFromIdentifier(identifier)
|
||||
local result = MySQL.Sync.fetchAll('SELECT * FROM `users` WHERE identifier = ?', { identifier })
|
||||
if not result[1] then
|
||||
return '', ''
|
||||
end
|
||||
result = result[1]
|
||||
return result?.firstname, result?.lastname
|
||||
end
|
||||
|
||||
RegisterServerCallback('qb-houses:GetInside', function(source, cb)
|
||||
local src = source
|
||||
local identifier = GetIdentifier(src)
|
||||
local fetch = ([[
|
||||
SELECT inside
|
||||
FROM %s
|
||||
WHERE %s = @id;
|
||||
]]):format(userTable, identifierColumn)
|
||||
local fetchData = { ['@id'] = identifier }
|
||||
local result = MySQL.Sync.fetchAll(fetch, fetchData)
|
||||
if result and result[1] then
|
||||
cb(result[1].inside)
|
||||
Debug('qb-houses:GetInside: ', result[1].inside)
|
||||
else
|
||||
cb(false)
|
||||
Debug('qb-houses:GetInside: ', false)
|
||||
end
|
||||
end)
|
||||
|
||||
function GetPlayerSQLDataFromIdentifier(identifier)
|
||||
local result = MySQL.Sync.fetchAll('SELECT * FROM `users` WHERE identifier = ?', { identifier })
|
||||
if result[1] then
|
||||
return result[1]
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function UpdateInside(src, insideId, bool)
|
||||
local identifier = GetIdentifier(src)
|
||||
local update = ([[
|
||||
UPDATE %s SET inside = @inside
|
||||
WHERE %s = @id;
|
||||
]]):format(userTable, identifierColumn)
|
||||
local updateData = {
|
||||
['@inside'] = insideId,
|
||||
['@id'] = identifier
|
||||
}
|
||||
if bool then
|
||||
MySQL.Sync.execute(update, updateData)
|
||||
else
|
||||
updateData = {
|
||||
['@inside'] = nil,
|
||||
['@id'] = identifier
|
||||
}
|
||||
MySQL.Sync.execute(update, updateData)
|
||||
end
|
||||
end
|
||||
|
||||
RegisterServerCallback('qb-phone:server:MeosGetPlayerHouses', function(source, cb, input)
|
||||
if input then
|
||||
local search = escape_sqli(input)
|
||||
local searchData = {}
|
||||
local query = 'SELECT * FROM `' .. userTable .. '` WHERE `' .. identifierColumn .. '` = "' .. search .. '"'
|
||||
-- Split on " " and check each var individual
|
||||
local searchParameters = SplitStringToArray(search)
|
||||
-- Construct query dynamicly for individual parm check
|
||||
if #searchParameters > 1 then
|
||||
query = query .. ' OR `firstname` LIKE "%' .. searchParameters[1] .. '%" OR `lastname` LIKE "%' .. searchParameters[1] .. '%"'
|
||||
for i = 2, #searchParameters do
|
||||
query = query .. ' OR `firstname` LIKE "%' .. searchParameters[i] .. '%" OR `lastname` LIKE "%' .. searchParameters[i] .. '%"'
|
||||
end
|
||||
else
|
||||
query = query .. ' OR `firstname` LIKE "%' .. search .. '%" OR `lastname` LIKE "%' .. search .. '%"'
|
||||
end
|
||||
local result = MySQL.Sync.fetchAll(query)
|
||||
if result[1] then
|
||||
local houses = MySQL.Sync.fetchAll('SELECT * FROM player_houses WHERE citizenid = ?',
|
||||
{ result[1][identifierColumn] })
|
||||
if houses[1] then
|
||||
for k, v in pairs(houses) do
|
||||
local charinfo = {
|
||||
firstname = result[1].firstname,
|
||||
lastname = result[1].lastname,
|
||||
}
|
||||
searchData[#searchData + 1] = {
|
||||
name = v.house,
|
||||
keyholders = v.keyholders,
|
||||
owner = v.citizenid,
|
||||
price = Config.Houses[v.house].price,
|
||||
label = Config.Houses[v.house].address,
|
||||
tier = Config.Houses[v.house].tier,
|
||||
garage = Config.Houses[v.house].garage,
|
||||
charinfo = charinfo,
|
||||
coords = {
|
||||
x = Config.Houses[v.house].coords.enter.x,
|
||||
y = Config.Houses[v.house].coords.enter.y,
|
||||
z = Config.Houses[v.house].coords.enter.z
|
||||
}
|
||||
}
|
||||
end
|
||||
cb(searchData)
|
||||
end
|
||||
else
|
||||
cb(nil)
|
||||
end
|
||||
else
|
||||
cb(nil)
|
||||
end
|
||||
end)
|
212
resources/[housing]/qs-housing/server/custom/framework/qb.lua
Normal file
212
resources/[housing]/qs-housing/server/custom/framework/qb.lua
Normal file
|
@ -0,0 +1,212 @@
|
|||
if Config.Framework ~= 'qb' then
|
||||
return
|
||||
end
|
||||
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
userTable = 'players' -- users
|
||||
identifierColumn = 'citizenid' -- identifier
|
||||
accountsColumn = 'money'
|
||||
|
||||
RegisterNetEvent('QBCore:Server:OnPlayerLoaded', function()
|
||||
local src = source
|
||||
Debug('Loaded player:', src)
|
||||
CreateQuests(src)
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
for k, v in pairs(QBCore.Functions.GetPlayers()) do
|
||||
if v then
|
||||
Debug('Loaded player:', v)
|
||||
CreateQuests(v)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function RegisterServerCallback(name, cb)
|
||||
QBCore.Functions.CreateCallback(name, cb)
|
||||
end
|
||||
|
||||
function RegisterUsableItem(name, cb)
|
||||
QBCore.Functions.CreateUseableItem(name, cb)
|
||||
end
|
||||
|
||||
function GetPlayerFromId(source)
|
||||
return QBCore.Functions.GetPlayer(source)
|
||||
end
|
||||
|
||||
function GetPlayerFromIdentifier(identifier)
|
||||
return QBCore.Functions.GetPlayerByCitizenId(identifier)
|
||||
end
|
||||
|
||||
function AddMoneyToAccount(account, amount, isNotRent)
|
||||
local source = GetPlayerSourceFromIdentifier(account)
|
||||
if source then
|
||||
AddAccountMoney(source, 'bank', amount)
|
||||
if isNotRent then return end
|
||||
TriggerClientEvent('qb-houses:sendTextMessage', source, Lang('HOUSING_NOTIFICATION_RENT_PAYMENT') .. amount, 'error')
|
||||
else
|
||||
local result = MySQL.Sync.fetchAll('SELECT ' .. accountsColumn .. ' FROM ' .. userTable .. ' WHERE ' .. identifierColumn .. ' = ?', { account })
|
||||
if not result[1] then return print('Add Money Account : Not finded this account: ' .. account) end
|
||||
local accounts = json.decode(result[1].money)
|
||||
accounts.bank = accounts.bank + amount
|
||||
MySQL.Sync.execute('UPDATE ' .. userTable .. ' SET ' .. accountsColumn .. ' = ? WHERE ' .. identifierColumn .. ' = ?', {
|
||||
json.encode(accounts),
|
||||
account
|
||||
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function PlayerIsAdmin(source)
|
||||
return QBCore.Functions.HasPermission(source, 'god') or IsPlayerAceAllowed(source, 'command') or QBCore.Functions.HasPermission(source, 'admin')
|
||||
end
|
||||
|
||||
function GetJobName(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
if not player then return '' end
|
||||
return player.PlayerData.job.name
|
||||
end
|
||||
|
||||
function GetCharacterName(source)
|
||||
local player = GetPlayerFromId(source).PlayerData.charinfo
|
||||
return player.firstname, player.lastname
|
||||
end
|
||||
|
||||
function GetAccountMoney(source, account)
|
||||
local player = GetPlayerFromId(source)
|
||||
if account == 'money' then account = 'cash' end
|
||||
if account == 'black_money' then account = 'crypto' end
|
||||
return player.PlayerData.money[account]
|
||||
end
|
||||
|
||||
function AddAccountMoney(source, account, amount)
|
||||
local player = GetPlayerFromId(source)
|
||||
if account == 'money' then account = 'cash' end
|
||||
player.Functions.AddMoney(account, amount)
|
||||
end
|
||||
|
||||
function RemoveAccountMoney(source, account, amount)
|
||||
local player = GetPlayerFromId(source)
|
||||
if account == 'money' then account = 'cash' end
|
||||
player.Functions.RemoveMoney(account, amount)
|
||||
end
|
||||
|
||||
function RemoveItem(source, item, count)
|
||||
local player = GetPlayerFromId(source)
|
||||
player.Functions.RemoveItem(item, count)
|
||||
end
|
||||
|
||||
function GetIdentifier(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
if not player then return false end
|
||||
return player.PlayerData.citizenid
|
||||
end
|
||||
|
||||
function GetPlayerSourceFromIdentifier(identifier)
|
||||
local player = GetPlayerFromIdentifier(identifier)
|
||||
if not player then return false end
|
||||
return player.PlayerData.source
|
||||
end
|
||||
|
||||
function GetPlayerSourceFromSource(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
return player.PlayerData.source
|
||||
end
|
||||
|
||||
function GetCharacterFromIdentifier(identifier)
|
||||
local result = MySQL.Sync.fetchAll('SELECT charinfo FROM `players` WHERE citizenid = ?', { identifier })
|
||||
if not result[1] then
|
||||
return '', ''
|
||||
end
|
||||
result = result[1]
|
||||
result = json.decode(result.charinfo)
|
||||
return result?.firstname, result?.lastname
|
||||
end
|
||||
|
||||
function RemoveMoneyFromAccount(account, amount, dontCheck)
|
||||
local source = GetPlayerSourceFromIdentifier(account)
|
||||
if source then
|
||||
RemoveAccountMoney(source, 'bank', amount)
|
||||
return true
|
||||
else
|
||||
local player = MySQL.Sync.fetchAll('SELECT ' .. accountsColumn .. ' FROM ' .. userTable .. ' WHERE ' .. identifierColumn .. ' = ?', { account })
|
||||
if player[1] then
|
||||
local accounts = json.decode(player[1].money)
|
||||
if accounts.bank >= amount or dontCheck then
|
||||
accounts.bank = accounts.bank - amount
|
||||
MySQL.Sync.execute('UPDATE ' .. userTable .. ' SET ' .. accountsColumn .. ' = ? WHERE ' .. identifierColumn .. ' = ?', { json.encode(accounts), account })
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function GetPlayerSQLDataFromIdentifier(identifier)
|
||||
local result = MySQL.Sync.fetchAll('SELECT * FROM `players` WHERE citizenid = ? LIMIT 1', { identifier })
|
||||
if result[1] then
|
||||
return result[1]
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function UpdateInside(src, insideId, bool)
|
||||
local Player = GetPlayerFromId(src)
|
||||
Player.Functions.SetMetaData('currentHouseId', bool and insideId or nil)
|
||||
end
|
||||
|
||||
RegisterServerCallback('qb-phone:server:MeosGetPlayerHouses', function(source, cb, input)
|
||||
if input then
|
||||
local search = escape_sqli(input)
|
||||
local searchData = {}
|
||||
local query = 'SELECT * FROM `' .. userTable .. '` WHERE `' .. identifierColumn .. '` = "' .. search .. '"'
|
||||
-- Split on " " and check each var individual
|
||||
local searchParameters = SplitStringToArray(search)
|
||||
-- Construct query dynamicly for individual parm check
|
||||
if #searchParameters > 1 then
|
||||
query = query .. ' OR `firstname` LIKE "%' .. searchParameters[1] .. '%" OR `lastname` LIKE "%' .. searchParameters[1] .. '%"'
|
||||
for i = 2, #searchParameters do
|
||||
query = query .. ' OR `firstname` LIKE "%' .. searchParameters[i] .. '%" OR `lastname` LIKE "%' .. searchParameters[i] .. '%"'
|
||||
end
|
||||
else
|
||||
query = query .. ' OR `firstname` LIKE "%' .. search .. '%" OR `lastname` LIKE "%' .. search .. '%"'
|
||||
end
|
||||
local result = MySQL.Sync.fetchAll(query)
|
||||
if result[1] then
|
||||
local houses = MySQL.Sync.fetchAll('SELECT * FROM player_houses WHERE citizenid = ?',
|
||||
{ result[1][identifierColumn] })
|
||||
if houses[1] then
|
||||
for k, v in pairs(houses) do
|
||||
local charinfo = {
|
||||
firstname = result[1].firstname,
|
||||
lastname = result[1].lastname,
|
||||
}
|
||||
searchData[#searchData + 1] = {
|
||||
name = v.house,
|
||||
keyholders = v.keyholders,
|
||||
owner = v.citizenid,
|
||||
price = Config.Houses[v.house].price,
|
||||
label = Config.Houses[v.house].address,
|
||||
tier = Config.Houses[v.house].tier,
|
||||
garage = Config.Houses[v.house].garage,
|
||||
charinfo = charinfo,
|
||||
coords = {
|
||||
x = Config.Houses[v.house].coords.enter.x,
|
||||
y = Config.Houses[v.house].coords.enter.y,
|
||||
z = Config.Houses[v.house].coords.enter.z
|
||||
}
|
||||
}
|
||||
end
|
||||
cb(searchData)
|
||||
end
|
||||
else
|
||||
cb(nil)
|
||||
end
|
||||
else
|
||||
cb(nil)
|
||||
end
|
||||
end)
|
|
@ -0,0 +1,189 @@
|
|||
if Config.Framework ~= 'standalone' then return end
|
||||
|
||||
-- ESX Callbacks
|
||||
local serverCallbacks = {}
|
||||
|
||||
local clientRequests = {}
|
||||
local RequestId = 0
|
||||
|
||||
---@param eventName string
|
||||
---@param callback function
|
||||
RegisterServerCallback = function(eventName, callback)
|
||||
serverCallbacks[eventName] = callback
|
||||
end
|
||||
|
||||
exports('RegisterServerCallback', RegisterServerCallback)
|
||||
|
||||
RegisterNetEvent('houses:triggerServerCallback', function(eventName, requestId, invoker, ...)
|
||||
if not serverCallbacks[eventName] then
|
||||
return print(('[^1ERROR^7] Server Callback not registered, name: ^5%s^7, invoker resource: ^5%s^7'):format(eventName, invoker))
|
||||
end
|
||||
|
||||
local source = source
|
||||
|
||||
serverCallbacks[eventName](source, function(...)
|
||||
TriggerClientEvent('houses:serverCallback', source, requestId, invoker, ...)
|
||||
end, ...)
|
||||
end)
|
||||
|
||||
---@param player number playerId
|
||||
---@param eventName string
|
||||
---@param callback function
|
||||
---@param ... any
|
||||
TriggerClientCallback = function(player, eventName, callback, ...)
|
||||
clientRequests[RequestId] = callback
|
||||
|
||||
TriggerClientEvent('houses:triggerClientCallback', player, eventName, RequestId, GetInvokingResource() or 'unknown', ...)
|
||||
|
||||
RequestId = RequestId + 1
|
||||
end
|
||||
|
||||
RegisterNetEvent('houses:clientCallback', function(requestId, invoker, ...)
|
||||
if not clientRequests[requestId] then
|
||||
return print(('[^1ERROR^7] Client Callback with requestId ^5%s^7 Was Called by ^5%s^7 but does not exist.'):format(requestId, invoker))
|
||||
end
|
||||
|
||||
clientRequests[requestId](...)
|
||||
clientRequests[requestId] = nil
|
||||
end)
|
||||
|
||||
function RegisterUsableItem(name, cb)
|
||||
ImplementError('RegisterUsableItem is not supported with standalone')
|
||||
return false
|
||||
end
|
||||
|
||||
function GetIdentifier(source)
|
||||
ImplementError('Get Identifier : You need to implement this function for your framework.')
|
||||
for k, v in pairs(GetPlayerIdentifiers(source)) do
|
||||
if string.sub(v, 1, string.len('license:')) == 'license:' then
|
||||
return v:gsub('license:', '')
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function GetPlayerFromId(source)
|
||||
return {
|
||||
source = source,
|
||||
identifier = GetIdentifier(source)
|
||||
}
|
||||
end
|
||||
|
||||
function GetPlayerSource(player)
|
||||
return player.source
|
||||
end
|
||||
|
||||
function GetPlayerFromIdentifier(identifier)
|
||||
identifier = string.gsub(identifier, ' ', '')
|
||||
local players = GetPlayers()
|
||||
for k, v in pairs(players) do
|
||||
if GetIdentifier(v) == identifier then
|
||||
return {
|
||||
source = v,
|
||||
identifier = identifier
|
||||
}
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function GetPlayerSourceFromIdentifier(identifier)
|
||||
local player = GetPlayerFromIdentifier(identifier)
|
||||
if player then
|
||||
return player.source
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function AddMoneyToAccount(account, amount, isNotRent)
|
||||
local source = GetPlayerSourceFromIdentifier(account)
|
||||
if source then
|
||||
AddAccountMoney(source, 'bank', amount)
|
||||
if isNotRent then return end
|
||||
TriggerClientEvent('qb-houses:sendTextMessage', source, Lang('HOUSING_NOTIFICATION_RENT_PAYMENT') .. amount, 'error')
|
||||
else
|
||||
ImplementError('Add Money Account : You need to implement this function for your framework.')
|
||||
end
|
||||
end
|
||||
|
||||
function GetCharacterName(source)
|
||||
ImplementError('Get Character Name : You need to implement this function for your framework.')
|
||||
return 'Unknown', 'Unknown'
|
||||
end
|
||||
|
||||
function GetAccountMoney(source, account)
|
||||
ImplementError('Get Account Money : You need to implement this function for your framework.')
|
||||
return 999999999999 -- for provide error
|
||||
end
|
||||
|
||||
function AddAccountMoney(source, account, amount)
|
||||
ImplementError('Add Account Money : You need to implement this function for your framework.')
|
||||
end
|
||||
|
||||
function RemoveAccountMoney(source, account, amount)
|
||||
ImplementError('Remove Account Money : You need to implement this function for your framework.')
|
||||
end
|
||||
|
||||
function RemoveItem(source, item, count)
|
||||
ImplementError('Remove Item : You need to implement this function for your framework.')
|
||||
end
|
||||
|
||||
function GetPlayerSourceFromIdentifier(identifier)
|
||||
local player = GetPlayerFromIdentifier(identifier)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
return player.source
|
||||
end
|
||||
|
||||
function GetPlayerSourceFromSource(source)
|
||||
local player = GetPlayerFromId(source)
|
||||
if not player then
|
||||
return false
|
||||
end
|
||||
return player.source
|
||||
end
|
||||
|
||||
function GetCharacterFromIdentifier(identifier)
|
||||
ImplementError('Get Character From Identifier : You need to implement this function for your framework.')
|
||||
return 'unknown', 'unknown'
|
||||
end
|
||||
|
||||
function GetJobName(source)
|
||||
ImplementError('Get Job Name : You need to implement this function for your framework.')
|
||||
return 'police'
|
||||
end
|
||||
|
||||
function RemoveMoneyFromAccount(account, amount, dontCheck)
|
||||
local source = GetPlayerSourceFromIdentifier(account)
|
||||
if source then
|
||||
RemoveAccountMoney(source, 'bank', amount)
|
||||
return true
|
||||
else
|
||||
ImplementError('Remove Money From Account : You need to implement this function for your framework.')
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function GetPlayerSQLDataFromIdentifier(identifier)
|
||||
ImplementError('Check Player Is Exist : You need to implement this function for your framework.')
|
||||
return true
|
||||
end
|
||||
|
||||
function UpdateInside(src, insideId, bool)
|
||||
ImplementError('Update Inside : You need to implement this function for your framework.')
|
||||
end
|
||||
|
||||
RegisterServerCallback('qb-phone:server:MeosGetPlayerHouses', function(source, cb, input)
|
||||
ImplementError('qb-phone:server:MeosGetPlayerHouses : You need to implement this function for your framework.')
|
||||
cb(nil)
|
||||
end)
|
||||
|
||||
RegisterServerCallback('houses:GetIdentifier', function(source, cb)
|
||||
local identifier = GetIdentifier(source)
|
||||
cb(identifier)
|
||||
end)
|
||||
|
||||
RegisterServerCallback('houses:GetPlayers', function(source, cb)
|
||||
cb(GetPlayers())
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue