structura foldere
mutat kq- folders in un singur folder [kq]
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
--[[
|
||||
Hi dear customer or developer, here you can fully configure your server's
|
||||
framework or you could even duplicate this file to create your own framework.
|
||||
|
||||
If you do not have much experience, we recommend you download the base version
|
||||
of the framework that you use in its latest version and it will work perfectly.
|
||||
]]
|
||||
|
||||
if Config.Framework ~= 'esx' then
|
||||
return
|
||||
end
|
||||
|
||||
ESX = exports['es_extended']:getSharedObject()
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded', function()
|
||||
if Config.EnableDelivery then
|
||||
InitDeliveries()
|
||||
end
|
||||
CreateBlips()
|
||||
CreatePeds()
|
||||
TriggerServerEvent('shops:server:SetShopList')
|
||||
end)
|
||||
|
||||
function GetPlayerData()
|
||||
return ESX.GetPlayerData()
|
||||
end
|
||||
|
||||
RegisterNetEvent('esx:setJob', function(jobInfo)
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerData.job = jobInfo
|
||||
end)
|
||||
|
||||
function GetPlayerIdentifier()
|
||||
return GetPlayerData()?.identifier
|
||||
end
|
||||
|
||||
function GetJobName()
|
||||
return GetPlayerData()?.job?.name
|
||||
end
|
||||
|
||||
function GetJobGrade()
|
||||
return GetPlayerData()?.job?.grade
|
||||
end
|
||||
|
||||
function TriggerServerCallback(name, cb, ...)
|
||||
ESX.TriggerServerCallback(name, cb, ...)
|
||||
end
|
||||
|
||||
function GetGangName()
|
||||
-- IMPLEMENT THIS TO YOUR GANG
|
||||
return 'nogang'
|
||||
end
|
||||
|
||||
function SendTextMessage(msg, type)
|
||||
if not type then type = 'inform' end
|
||||
if type == 'inform' then
|
||||
SetNotificationTextEntry('STRING')
|
||||
AddTextComponentString(msg)
|
||||
DrawNotification(0, 1)
|
||||
end
|
||||
if type == 'error' then
|
||||
SetNotificationTextEntry('STRING')
|
||||
AddTextComponentString(msg)
|
||||
DrawNotification(0, 1)
|
||||
end
|
||||
if type == 'success' then
|
||||
SetNotificationTextEntry('STRING')
|
||||
AddTextComponentString(msg)
|
||||
DrawNotification(0, 1)
|
||||
end
|
||||
end
|
||||
|
||||
local texts = {}
|
||||
if GetResourceState('qs-textui') == 'started' then
|
||||
function DrawText3D(x, y, z, text, id, key)
|
||||
local _id = id
|
||||
if not texts[_id] then
|
||||
CreateThread(function()
|
||||
texts[_id] = 5
|
||||
while texts[_id] > 0 do
|
||||
texts[_id] = texts[_id] - 1
|
||||
Wait(0)
|
||||
end
|
||||
texts[_id] = nil
|
||||
exports['qs-textui']:DeleteDrawText3D(id)
|
||||
print('Deleted text', id)
|
||||
end)
|
||||
TriggerEvent('textui:DrawText3D', x, y, z, text, id, key)
|
||||
end
|
||||
texts[_id] = 5
|
||||
end
|
||||
else
|
||||
function DrawText3D(x, y, z, text)
|
||||
SetTextScale(0.35, 0.35)
|
||||
SetTextFont(4)
|
||||
SetTextProportional(1)
|
||||
SetTextColour(255, 255, 255, 215)
|
||||
SetTextEntry('STRING')
|
||||
SetTextCentre(true)
|
||||
AddTextComponentString(text)
|
||||
SetDrawOrigin(x, y, z, 0)
|
||||
DrawText(0.0, 0.0)
|
||||
local factor = text:len() / 370
|
||||
DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75)
|
||||
ClearDrawOrigin()
|
||||
end
|
||||
end
|
||||
|
||||
function ProgressBar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel)
|
||||
if lib.progressCircle({
|
||||
duration = duration,
|
||||
label = label,
|
||||
position = 'bottom',
|
||||
useWhileDead = useWhileDead,
|
||||
canCancel = canCancel,
|
||||
disable = disableControls,
|
||||
anim = {
|
||||
dict = animation.animDict,
|
||||
clip = animation.anim,
|
||||
flag = animation?.flags
|
||||
},
|
||||
prop = prop
|
||||
}) then
|
||||
onFinish()
|
||||
else
|
||||
if onCancel then
|
||||
onCancel()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent('qb-shops:client:SpawnVehicle', function()
|
||||
local coords = Config.DeliveryLocations['vehicleWithdraw']
|
||||
TriggerServerCallback('esx:spawnVehicle', function()
|
||||
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
|
||||
SetVehicleNumberPlateText(veh, 'TRUK' .. tostring(math.random(1000, 9999)))
|
||||
SetEntityHeading(veh, coords.w)
|
||||
SetVehicleLivery(veh, 1)
|
||||
SetVehicleColours(veh, 122, 122)
|
||||
exports[Config.Fuel]:SetFuel(veh, 100.0)
|
||||
TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1)
|
||||
SetEntityAsMissionEntity(veh, true, true)
|
||||
TriggerEvent('vehiclekeys:client:SetOwner', GetPlate(veh))
|
||||
SetVehicleEngineOn(veh, true, true, false)
|
||||
CurrentPlate = GetPlate(veh)
|
||||
GetNewLocation()
|
||||
end, {
|
||||
model = 'boxville2',
|
||||
coords = vec3(coords.x, coords.y, coords.z),
|
||||
heading = coords.w,
|
||||
warp = true
|
||||
})
|
||||
end)
|
||||
|
||||
function GetPlate(veh)
|
||||
return ESX.Math.Trim(GetVehicleNumberPlateText(veh))
|
||||
end
|
||||
@@ -0,0 +1,159 @@
|
||||
--[[
|
||||
Hi dear customer or developer, here you can fully configure your server's
|
||||
framework or you could even duplicate this file to create your own framework.
|
||||
|
||||
If you do not have much experience, we recommend you download the base version
|
||||
of the framework that you use in its latest version and it will work perfectly.
|
||||
]]
|
||||
|
||||
if Config.Framework ~= 'qb' then
|
||||
return
|
||||
end
|
||||
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
WeaponList = QBCore.Shared.Weapons
|
||||
ItemList = QBCore.Shared.Items
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
|
||||
if Config.EnableDelivery then
|
||||
InitDeliveries()
|
||||
end
|
||||
CreateBlips()
|
||||
CreatePeds()
|
||||
TriggerServerEvent('shops:server:SetShopList')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
|
||||
DeletePeds()
|
||||
PlayerData = nil
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnGangUpdate', function(gangInfo)
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerData.gang = gangInfo
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnJobUpdate', function(jobInfo)
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerData.job = jobInfo
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Player:SetPlayerData', function(val)
|
||||
PlayerData = val
|
||||
end)
|
||||
|
||||
function GetPlayerData()
|
||||
return QBCore.Functions.GetPlayerData()
|
||||
end
|
||||
|
||||
function GetPlayerIdentifier()
|
||||
return GetPlayerData()?.citizenid
|
||||
end
|
||||
|
||||
function GetJobName()
|
||||
return GetPlayerData()?.job?.name
|
||||
end
|
||||
|
||||
function GetJobGrade()
|
||||
return GetPlayerData()?.job?.grade?.level
|
||||
end
|
||||
|
||||
function TriggerServerCallback(name, cb, ...)
|
||||
QBCore.Functions.TriggerCallback(name, cb, ...)
|
||||
end
|
||||
|
||||
function SendTextMessage(msg, type)
|
||||
if not type then type = 'inform' end
|
||||
if type == 'inform' then
|
||||
QBCore.Functions.Notify(msg, 'primary', 5000)
|
||||
end
|
||||
if type == 'error' then
|
||||
QBCore.Functions.Notify(msg, 'error', 5000)
|
||||
end
|
||||
if type == 'success' then
|
||||
QBCore.Functions.Notify(msg, 'success', 5000)
|
||||
end
|
||||
end
|
||||
|
||||
function GetGangName()
|
||||
return GetPlayerData()?.gang?.name
|
||||
end
|
||||
|
||||
local texts = {}
|
||||
if GetResourceState('qs-textui') == 'started' then
|
||||
function DrawText3D(x, y, z, text, id, key)
|
||||
local _id = id
|
||||
if not texts[_id] then
|
||||
CreateThread(function()
|
||||
texts[_id] = 5
|
||||
while texts[_id] > 0 do
|
||||
texts[_id] = texts[_id] - 1
|
||||
Wait(0)
|
||||
end
|
||||
texts[_id] = nil
|
||||
exports['qs-textui']:DeleteDrawText3D(id)
|
||||
print('Deleted text', id)
|
||||
end)
|
||||
TriggerEvent('textui:DrawText3D', x, y, z, text, id, key)
|
||||
end
|
||||
texts[_id] = 5
|
||||
end
|
||||
else
|
||||
function DrawText3D(x, y, z, text)
|
||||
SetTextScale(0.35, 0.35)
|
||||
SetTextFont(4)
|
||||
SetTextProportional(1)
|
||||
SetTextColour(255, 255, 255, 215)
|
||||
SetTextEntry('STRING')
|
||||
SetTextCentre(true)
|
||||
AddTextComponentString(text)
|
||||
SetDrawOrigin(x, y, z, 0)
|
||||
DrawText(0.0, 0.0)
|
||||
local factor = text:len() / 370
|
||||
DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75)
|
||||
ClearDrawOrigin()
|
||||
end
|
||||
end
|
||||
|
||||
function ProgressBar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel)
|
||||
if lib.progressCircle({
|
||||
duration = duration,
|
||||
label = label,
|
||||
position = 'bottom',
|
||||
useWhileDead = useWhileDead,
|
||||
canCancel = canCancel,
|
||||
disable = disableControls,
|
||||
anim = {
|
||||
dict = animation.animDict,
|
||||
clip = animation.anim,
|
||||
flag = animation?.flag
|
||||
},
|
||||
prop = prop
|
||||
}) then
|
||||
onFinish()
|
||||
else
|
||||
onCancel()
|
||||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent('qb-shops:client:SpawnVehicle', function()
|
||||
local coords = Config.DeliveryLocations['vehicleWithdraw']
|
||||
TriggerServerCallback('QBCore:Server:SpawnVehicle', function(netId)
|
||||
local veh = NetToVeh(netId)
|
||||
SetVehicleNumberPlateText(veh, 'TRUK' .. tostring(math.random(1000, 9999)))
|
||||
SetEntityHeading(veh, coords.w)
|
||||
SetVehicleLivery(veh, 1)
|
||||
SetVehicleColours(veh, 122, 122)
|
||||
exports[Config.Fuel]:SetFuel(veh, 100.0)
|
||||
TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1)
|
||||
SetEntityAsMissionEntity(veh, true, true)
|
||||
TriggerEvent('vehiclekeys:client:SetOwner', GetPlate(veh))
|
||||
SetVehicleEngineOn(veh, true, true, false)
|
||||
CurrentPlate = GetPlate(veh)
|
||||
GetNewLocation()
|
||||
end, 'boxville2', coords, false)
|
||||
end)
|
||||
|
||||
function GetPlate(veh)
|
||||
return QBCore.Functions.GetPlate(veh)
|
||||
end
|
||||
@@ -0,0 +1,64 @@
|
||||
if not Config.UseTarget then
|
||||
return
|
||||
end
|
||||
|
||||
local target_name = GetResourceState('ox_target'):find('started') and 'qtarget' or 'qb-target'
|
||||
|
||||
function InitializeTargetPed(k, v, ped)
|
||||
local defaultTargetIcon = 'fas fa-shopping-cart'
|
||||
local defaultTargetLabel = 'Open Shop'
|
||||
|
||||
if ped then
|
||||
exports[target_name]:AddTargetEntity(ped, {
|
||||
options = {
|
||||
{
|
||||
label = v.targetLabel or defaultTargetLabel,
|
||||
icon = v.targetIcon or defaultTargetIcon,
|
||||
item = v.requiredItem,
|
||||
type = 'server',
|
||||
event = 'qb-shops:server:openShop',
|
||||
shop = k,
|
||||
}
|
||||
},
|
||||
distance = 2.0
|
||||
})
|
||||
else
|
||||
exports[target_name]:AddCircleZone(k, vector3(v.coords.x, v.coords.y, v.coords.z), 0.5, {
|
||||
name = k,
|
||||
debugPoly = Config.ZoneDebug,
|
||||
useZ = true
|
||||
}, {
|
||||
options = {
|
||||
{
|
||||
label = v.targetLabel or defaultTargetLabel,
|
||||
icon = v.targetIcon or defaultTargetIcon,
|
||||
item = v.requiredItem,
|
||||
type = 'server',
|
||||
event = 'qb-shops:server:openShop',
|
||||
shop = k,
|
||||
}
|
||||
},
|
||||
distance = 2.0
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
for k, v in pairs(Config.Stashes) do
|
||||
exports[target_name]:AddCircleZone(v.label .. k, vector3(v.coords.x, v.coords.y, v.coords.z), 0.5, {
|
||||
name = v.label .. k,
|
||||
debugPoly = false,
|
||||
useZ = true
|
||||
}, {
|
||||
options = {
|
||||
{
|
||||
label = v.targetLabel,
|
||||
icon = 'fas fa-shopping-cart',
|
||||
event = 'shops:openStash',
|
||||
stash = v
|
||||
}
|
||||
},
|
||||
distance = 2.0
|
||||
})
|
||||
end
|
||||
end)
|
||||
Binary file not shown.
BIN
resources/[framework]/[addons]/[quasar]/qs-shops/client/main.lua
Normal file
BIN
resources/[framework]/[addons]/[quasar]/qs-shops/client/main.lua
Normal file
Binary file not shown.
Reference in New Issue
Block a user