You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ESX = nil
Citizen.CreateThread(function()
local QBCore = exports['qb-core']:GetCoreObject()
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
Citizen.Wait(0)
end
while QBCore.Functions.GetPlayerData().job == nil do
Citizen.Wait(100)
end
ESX.PlayerData = QBCore.Functions.GetPlayerData()
end)
RegisterNetEvent("Cat:Fiv:RemoveProp")
AddEventHandler("Cat:Fiv:RemoveProp", function()
if WeaponNow ~= nil then
for k,v in pairs(Config.item) do
if v.ItemWeapon ~= nil then
if v.ItemWeapon == WeaponNow then
Limit = Limit - 1
TriggerEvent(''..v.itemname..':SPAWN', v)
end
end
if Limit <= 0 then
Limit = 4
break
end
end
end
SetCurrentPedWeapon(PlayerPedId(), 'WEAPON_UNARMED', true)
end)
local WeaponNow = nil
local Isdead = false
local Limit = 4
AddEventHandler('QBCore:Client:OnPlayerUnload', function(data)
Isdead = true
if WeaponNow ~= nil then
for k,v in pairs(Config.item) do
if v.ItemWeapon ~= nil then
if v.ItemWeapon == WeaponNow then
Limit = Limit - 1
TriggerEvent(''..v.itemname..':SPAWN', v)
end
end
if Limit <= 0 then
Limit = 4
break
end
end
end
SetCurrentPedWeapon(PlayerPedId(), 'WEAPON_UNARMED', true)
WeaponNow = nil
end)
RegisterNetEvent('SelectWeaponMRB')
AddEventHandler('SelectWeaponMRB', function(NameWeapon)
if GetSelectedPedWeapon(GetPlayerPed(-1)) ~= GetHashKey("WEAPON_UNARMED") then
if Isdead then
Isdead = false
return
end
if WeaponNow == nil then
WeaponNow = NameWeapon
else
if WeaponNow ~= NameWeapon then
for k,v in pairs(Config.item) do
if v.ItemWeapon ~= nil then
if v.ItemWeapon == WeaponNow then
Limit = Limit - 1
TriggerEvent(''..v.itemname..':SPAWN', v)
end
end
if Limit <= 0 then
Limit = 4
break
end
end
WeaponNow = NameWeapon
end
end
for k,v in pairs(Config.item) do
if v.ItemWeapon ~= nil then
if v.ItemWeapon == WeaponNow then
Limit = Limit - 1
TriggerEvent(''..v.itemname..':SPAWN', v)
end
end
if Limit <= 0 then
Limit = 4
break
end
end
else
if WeaponNow ~= nil then
for k,v in pairs(Config.item) do
if v.ItemWeapon ~= nil then
if v.ItemWeapon == WeaponNow then
Limit = Limit - 1
TriggerEvent(''..v.itemname..':SPAWN', v)
end
end
if Limit <= 0 then
Limit = 4
break
end
end
end
WeaponNow = nil
end
end)
for k,v in pairs(Config.item) do
Citizen.CreateThread(function()
local onSpawn = false
local HandObject = nil
RegisterNetEvent(''..v.itemname..':SPAWN')
AddEventHandler(''..v.itemname..':SPAWN', function(CurrentZone)
if not onSpawn then
onSpawn = true
local playerped = PlayerPedId()
local temp = false
local Object = CreateObject(GetHashKey(CurrentZone.Model), x, y, z, true, true, true)
HandObject = Object
SetEntityAsMissionEntity(HandObject, true, false)
AttachEntityToEntity(HandObject, playerped, GetPedBoneIndex(playerped, CurrentZone.Bone), CurrentZone.xPos, CurrentZone.yPos, CurrentZone.zPos, CurrentZone.xRot, CurrentZone.yRot,CurrentZone.zRot, true, true, false, true, 0, true)
local netid = NetworkGetNetworkIdFromEntity(HandObject)
TriggerServerEvent('XNS-delprops:sv:cache', netid)
temp = true
if CurrentZone.EffectBone ~= nil then
Citizen.CreateThread(function()
for key, value in pairs(CurrentZone.EffectBone) do
RequestNamedPtfxAsset(value.particleDictionary)
while not HasNamedPtfxAssetLoaded(value.particleDictionary) do
Citizen.Wait(0)
end
end
while not temp do
Wait(0)
end
for key, value in pairs(CurrentZone.EffectBone) do
if value.Loop then
SetPtfxAssetNextCall(value.particleDictionary)
-- StartNetworkedParticleFxLoopedOnEntityBone(effectName, entity, xOffset, yOffset, zOffset, xRot, yRot, zRot, boneIndex, scale, xAxis, yAxis, zAxis)
local particle = StartNetworkedParticleFxNonLoopedOnPedBone(value.particleName, playerped , value.xPos, value.yPos, value.zPos, value.xRot, value.yRot,value.zRot, value.Bone, value.scale, false, false, false)
end
if value.LoopedOn then
SetPtfxAssetNextCall(value.particleDictionary)
local particle = StartNetworkedParticleFxLoopedOnEntityBone(value.particleName, playerped,value.xPos, value.yPos, value.zPos, value.xRot, value.yRot,value.zRot, value.Bone, value.scale,false,false,false)
--print(particle)
end
end
while DoesEntityExist(Object) do
for key, value in pairs(CurrentZone.EffectBone) do
if not value.Loop and not value.LoopedOn then
SetPtfxAssetNextCall(value.particleDictionary)
local particle = StartNetworkedParticleFxNonLoopedOnPedBone(value.particleName, playerped , value.xPos, value.yPos, value.zPos, value.xRot, value.yRot,value.zRot, value.Bone, value.scale, false, false, false)
end
end
Citizen.Wait(2000)
end
end)
elseif CurrentZone.particleDictionary ~=nil then
Citizen.CreateThread(function()
local particleDictionary = CurrentZone.particleDictionary
local particleName = CurrentZone.particleName
RequestNamedPtfxAsset(particleDictionary)
while not HasNamedPtfxAssetLoaded(particleDictionary) do
Citizen.Wait(0)
end
while not temp do
Wait(0)
end
while DoesEntityExist(Object) do
SetPtfxAssetNextCall(particleDictionary)
local particle = StartNetworkedParticleFxNonLoopedOnPedBone(particleName, playerped , 0.15, -0.2, 0.0, 0.0, -90.0, 60.0, CurrentZone.Bone, CurrentZone.scale, false, false, false)
Citizen.Wait(1500)
end
end)
end
if CurrentZone.animDictionary ~=nil then
loadAnimDict(CurrentZone.animDictionary)
TaskPlayAnim(playerped, CurrentZone.animDictionary, CurrentZone.animationName , 2.0, 2.0, -1, 1, 0, false,false, false)
Wait( CurrentZone.timeanimation*5000 )
ClearPedTasksImmediately(playerped)
end
if v.weight then
TriggerServerEvent("setw",v.weight)
end
else
RemoveParticleFxFromEntity(PlayerPedId())
DeleteObject(HandObject)
if v.weight then
TriggerServerEvent("setd",v.weight)
end
onSpawn = false
end
end)
end)
end
RegisterNetEvent('XNS-delprops:cl:removebyhash')
AddEventHandler('XNS-delprops:cl:removebyhash', function(hash, xCoords)
local idHash = NetworkGetEntityFromNetworkId(hash)
local coords = xCoords
SetEntityAsMissionEntity(idHash, false, true)
SetObjectAsNoLongerNeeded(idHash)
Citizen.Wait(1000)
Clear_Prop(coords,idHash)
end)
function Clear_Prop(coords,idHash)
Citizen.Wait(3000)
RemoveParticleFxFromEntity(PlayerPedId())
DeleteObject(idHash)
ClearAreaOfObjects(coords.x, coords.y, coords.z, 2.0, 0)
end
AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then
RemoveParticleFxFromEntity(PlayerPedId())
DeleteObject(HandObject)
end
end)
function loadAnimDict(dict)
while (not HasAnimDictLoaded(dict)) do
RequestAnimDict(dict)
Citizen.Wait(1)
end
end
-- local effon = false
-- RegisterCommand('enablee', function(source, args, RawCommand)
-- while not HasNamedPtfxAssetLoaded("jpx_ef_flower") do
-- RequestNamedPtfxAsset("jpx_ef_flower")
-- Wait(0)
-- end
-- if not effon then
-- UseParticleFxAsset("jpx_ef_flower")
-- effon = StartNetworkedParticleFxLoopedOnEntity("jpx_ef_flower", PlayerPedId(),0.0,0.0,0.1,0.0,0.0,0.0,1.5,false,false,false)
-- else
-- effon = false
-- RemoveParticleFxFromEntity(PlayerPedId())
-- --print(effon)
-- end
-- end)
-- Citizen.CreateThread(function()
-- while not HasNamedPtfxAssetLoaded("jpx_ef_star") do
-- RequestNamedPtfxAsset("jpx_ef_star")
-- Wait(0)
-- end
-- while true do
-- Citizen.Wait(1000)
-- local ped = PlayerPedId()
-- UseParticleFxAsset("jpx_ef_star")
-- local light = StartNetworkedParticleFxNonLoopedOnEntity("jpx_ef_star",PlayerPedId(),0.0,0.0,0.0,0.0,0.0,0.0,5.0,false,false,false)
-- end
-- end)
The text was updated successfully, but these errors were encountered:
ESX = nil
Citizen.CreateThread(function()
local QBCore = exports['qb-core']:GetCoreObject()
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
Citizen.Wait(0)
end
while QBCore.Functions.GetPlayerData().job == nil do
Citizen.Wait(100)
end
ESX.PlayerData = QBCore.Functions.GetPlayerData()
end)
RegisterNetEvent("Cat:Fiv:RemoveProp")
AddEventHandler("Cat:Fiv:RemoveProp", function()
if WeaponNow ~= nil then
end)
local WeaponNow = nil
local Isdead = false
local Limit = 4
AddEventHandler('QBCore:Client:OnPlayerUnload', function(data)
Isdead = true
if WeaponNow ~= nil then
end)
RegisterNetEvent('SelectWeaponMRB')
AddEventHandler('SelectWeaponMRB', function(NameWeapon)
if GetSelectedPedWeapon(GetPlayerPed(-1)) ~= GetHashKey("WEAPON_UNARMED") then
if Isdead then
Isdead = false
return
end
if WeaponNow == nil then
WeaponNow = NameWeapon
else
if WeaponNow ~= NameWeapon then
for k,v in pairs(Config.item) do
if v.ItemWeapon ~= nil then
if v.ItemWeapon == WeaponNow then
Limit = Limit - 1
TriggerEvent(''..v.itemname..':SPAWN', v)
end)
for k,v in pairs(Config.item) do
Citizen.CreateThread(function()
local onSpawn = false
local HandObject = nil
RegisterNetEvent(''..v.itemname..':SPAWN')
AddEventHandler(''..v.itemname..':SPAWN', function(CurrentZone)
if not onSpawn then
onSpawn = true
local playerped = PlayerPedId()
local temp = false
local Object = CreateObject(GetHashKey(CurrentZone.Model), x, y, z, true, true, true)
HandObject = Object
SetEntityAsMissionEntity(HandObject, true, false)
AttachEntityToEntity(HandObject, playerped, GetPedBoneIndex(playerped, CurrentZone.Bone), CurrentZone.xPos, CurrentZone.yPos, CurrentZone.zPos, CurrentZone.xRot, CurrentZone.yRot,CurrentZone.zRot, true, true, false, true, 0, true)
local netid = NetworkGetNetworkIdFromEntity(HandObject)
TriggerServerEvent('XNS-delprops:sv:cache', netid)
temp = true
end
RegisterNetEvent('XNS-delprops:cl:removebyhash')
AddEventHandler('XNS-delprops:cl:removebyhash', function(hash, xCoords)
local idHash = NetworkGetEntityFromNetworkId(hash)
local coords = xCoords
SetEntityAsMissionEntity(idHash, false, true)
SetObjectAsNoLongerNeeded(idHash)
Citizen.Wait(1000)
Clear_Prop(coords,idHash)
end)
function Clear_Prop(coords,idHash)
Citizen.Wait(3000)
RemoveParticleFxFromEntity(PlayerPedId())
DeleteObject(idHash)
ClearAreaOfObjects(coords.x, coords.y, coords.z, 2.0, 0)
end
AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then
RemoveParticleFxFromEntity(PlayerPedId())
DeleteObject(HandObject)
end
end)
function loadAnimDict(dict)
while (not HasAnimDictLoaded(dict)) do
RequestAnimDict(dict)
Citizen.Wait(1)
end
end
-- RegisterCommand('cleareff', function(source, args, RawCommand)
-- RemoveParticleFxFromEntity(PlayerPedId())
-- end)
-- local effon = false
-- RegisterCommand('enablee', function(source, args, RawCommand)
-- while not HasNamedPtfxAssetLoaded("jpx_ef_flower") do
-- RequestNamedPtfxAsset("jpx_ef_flower")
-- Wait(0)
-- end
-- if not effon then
-- UseParticleFxAsset("jpx_ef_flower")
-- effon = StartNetworkedParticleFxLoopedOnEntity("jpx_ef_flower", PlayerPedId(),0.0,0.0,0.1,0.0,0.0,0.0,1.5,false,false,false)
-- else
-- effon = false
-- RemoveParticleFxFromEntity(PlayerPedId())
-- --print(effon)
-- end
-- end)
-- Citizen.CreateThread(function()
-- while not HasNamedPtfxAssetLoaded("jpx_ef_star") do
-- RequestNamedPtfxAsset("jpx_ef_star")
-- Wait(0)
-- end
-- while true do
-- Citizen.Wait(1000)
-- local ped = PlayerPedId()
-- UseParticleFxAsset("jpx_ef_star")
-- local light = StartNetworkedParticleFxNonLoopedOnEntity("jpx_ef_star",PlayerPedId(),0.0,0.0,0.0,0.0,0.0,0.0,5.0,false,false,false)
-- end
-- end)
The text was updated successfully, but these errors were encountered: