structura foldere
mutat kq- folders in un singur folder [kq]
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
function OnHeistCreated()
|
||||
|
||||
end
|
||||
|
||||
function OnVehicleStartDroppingOff(source, vehEntity)
|
||||
-- Server-side gang check: prevent non-gang members from dropping off stolen vehicles
|
||||
if Config.requireGang and not IsInGang(source) then
|
||||
TriggerClientEvent('kq_carheist:gangCheckFailed', source)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function OnVehicleDroppedOff(source, vehicle, reward)
|
||||
|
||||
end
|
||||
|
||||
function OnTrackerRemoved(source, coords)
|
||||
|
||||
end
|
||||
|
||||
|
||||
----------------------
|
||||
-- TRACKERS
|
||||
----------------------
|
||||
RegisterServerEvent('kq_carheist:removeTracker')
|
||||
AddEventHandler('kq_carheist:removeTracker', function(vehKey, coords)
|
||||
sellableVehicles[vehKey].tracker = false
|
||||
sellableVehicles[vehKey].trackerCoords = coords
|
||||
TriggerClientEvent('kq_carheist:syncSellableVehicles', -1, sellableVehicles)
|
||||
Citizen.CreateThread(function()
|
||||
Citizen.Wait(Config.tracker.stayOnMapAfterRemovalTime)
|
||||
if sellableVehicles[vehKey] then
|
||||
sellableVehicles[vehKey].trackerCoords = nil
|
||||
end
|
||||
end)
|
||||
|
||||
OnTrackerRemoved(source, coords)
|
||||
end)
|
||||
@@ -0,0 +1,45 @@
|
||||
if Config.esxSettings.enabled then
|
||||
ESX = nil
|
||||
|
||||
if Config.esxSettings.useNewESXExport then
|
||||
ESX = exports['es_extended']:getSharedObject()
|
||||
else
|
||||
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
|
||||
end
|
||||
|
||||
function HasItem(player, item)
|
||||
local xPlayer = ESX.GetPlayerFromId(player)
|
||||
|
||||
return xPlayer.getInventoryItem(item).count >= 1
|
||||
end
|
||||
|
||||
function IsPolice(player)
|
||||
local xPlayer = ESX.GetPlayerFromId(player)
|
||||
if not xPlayer then
|
||||
return false
|
||||
end
|
||||
local job = xPlayer.getJob()
|
||||
|
||||
return Contains(Config.policeJobNames, job.name)
|
||||
end
|
||||
|
||||
function GetPoliceCount()
|
||||
local currentOfficers = 0
|
||||
for _, playerId in ipairs(GetPlayers()) do
|
||||
playerId = tonumber(playerId)
|
||||
if IsPolice(playerId) then
|
||||
currentOfficers = currentOfficers + 1
|
||||
end
|
||||
end
|
||||
return currentOfficers
|
||||
end
|
||||
|
||||
function AddMoney(player, amount)
|
||||
local xPlayer = ESX.GetPlayerFromId(player)
|
||||
if not xPlayer then
|
||||
return false
|
||||
end
|
||||
|
||||
xPlayer.addAccountMoney(Config.esxSettings.moneyAccount, amount)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,57 @@
|
||||
if Config.qbSettings.enabled then
|
||||
if Config.qbSettings.useNewQBExport then
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
end
|
||||
|
||||
function HasItem(player, item)
|
||||
local xPlayer = QBCore.Functions.GetPlayer(player)
|
||||
|
||||
return xPlayer.Functions.GetItemByName(item)
|
||||
end
|
||||
|
||||
function IsPolice(player)
|
||||
local xPlayer = QBCore.Functions.GetPlayer(player)
|
||||
if not xPlayer then
|
||||
return false
|
||||
end
|
||||
|
||||
local job = xPlayer.PlayerData.job
|
||||
|
||||
return Contains(Config.policeJobNames, job.name)
|
||||
end
|
||||
|
||||
function IsInGang(player)
|
||||
local xPlayer = QBCore.Functions.GetPlayer(player)
|
||||
if not xPlayer then
|
||||
return false
|
||||
end
|
||||
|
||||
local gang = xPlayer.PlayerData.gang
|
||||
if not gang then
|
||||
return false
|
||||
end
|
||||
|
||||
return gang.name ~= nil and gang.name ~= 'none' and gang.name ~= ''
|
||||
end
|
||||
|
||||
function GetPoliceCount()
|
||||
local currentOfficers = 0
|
||||
for _, playerId in ipairs(GetPlayers()) do
|
||||
playerId = tonumber(playerId)
|
||||
if IsPolice(playerId) then
|
||||
currentOfficers = currentOfficers + 1
|
||||
end
|
||||
end
|
||||
return currentOfficers
|
||||
end
|
||||
|
||||
function AddMoney(player, amount)
|
||||
local xPlayer = QBCore.Functions.GetPlayer(player)
|
||||
|
||||
if not xPlayer then
|
||||
return false
|
||||
end
|
||||
|
||||
xPlayer.Functions.AddMoney(Config.qbSettings.moneyAccount, amount)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user