forked from Simnation/Main
neue sachen
This commit is contained in:
parent
e542e77789
commit
b992cdcfef
119 changed files with 5522 additions and 0 deletions
47
resources/[test]/qs-weed/server/custom/framework/qb.lua
Normal file
47
resources/[test]/qs-weed/server/custom/framework/qb.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
if Config.Framework ~= 'qb' then
|
||||
return
|
||||
end
|
||||
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterNetEvent('QBCore:Server:OnPlayerLoaded', function()
|
||||
local src = source
|
||||
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 GetItem(player, item)
|
||||
local data = player.Functions.GetItemByName(item)
|
||||
data.count = data.amount
|
||||
return data
|
||||
end
|
||||
|
||||
function AddItem(source, item, count)
|
||||
local player = GetPlayerFromId(source)
|
||||
return player.Functions.AddItem(item, count)
|
||||
end
|
||||
|
||||
function RemoveItem(source, item, count, slot)
|
||||
local player = GetPlayerFromId(source)
|
||||
player.Functions.RemoveItem(item, count, slot)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue