Add files via upload
This commit is contained in:
parent
1824c3d614
commit
31bfa4079e
47
main.lua
Normal file
47
main.lua
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
ESX = nil
|
||||||
|
|
||||||
|
local box = nil
|
||||||
|
local animlib = 'anim@mp_fireworks'
|
||||||
|
|
||||||
|
|
||||||
|
RegisterNetEvent('frobski-fireworks:start')
|
||||||
|
AddEventHandler('frobski-fireworks:start', function()
|
||||||
|
|
||||||
|
RequestAnimDict(animlib)
|
||||||
|
|
||||||
|
while not HasAnimDictLoaded(animlib) do
|
||||||
|
Citizen.Wait(10)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not HasNamedPtfxAssetLoaded("scr_indep_fireworks") then
|
||||||
|
RequestNamedPtfxAsset("scr_indep_fireworks")
|
||||||
|
while not HasNamedPtfxAssetLoaded("scr_indep_fireworks") do
|
||||||
|
Wait(10)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local pedcoords = GetEntityCoords(GetPlayerPed(-1))
|
||||||
|
local ped = GetPlayerPed(-1)
|
||||||
|
local times = 20
|
||||||
|
|
||||||
|
TaskPlayAnim(ped, animlib, 'place_firework_3_box', -1, -8.0, 3000, 0, 0, false, false, false)
|
||||||
|
Citizen.Wait(4000)
|
||||||
|
ClearPedTasks(ped)
|
||||||
|
|
||||||
|
box = CreateObject(GetHashKey('ind_prop_firework_03'), pedcoords, true, false, false)
|
||||||
|
PlaceObjectOnGroundProperly(box)
|
||||||
|
FreezeEntityPosition(box, true)
|
||||||
|
local firecoords = GetEntityCoords(box)
|
||||||
|
|
||||||
|
Citizen.Wait(10000)
|
||||||
|
repeat
|
||||||
|
UseParticleFxAssetNextCall("scr_indep_fireworks")
|
||||||
|
local part1 = StartNetworkedParticleFxNonLoopedAtCoord("scr_indep_firework_trailburst", firecoords, 0.0, 0.0, 0.0, 1.0, false, false, false, false)
|
||||||
|
times = times - 1
|
||||||
|
Citizen.Wait(2000)
|
||||||
|
until(times == 0)
|
||||||
|
DeleteEntity(box)
|
||||||
|
box = nil
|
||||||
|
end)
|
||||||
|
|
11
server.lua
Normal file
11
server.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
ESX = nil
|
||||||
|
|
||||||
|
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
|
||||||
|
|
||||||
|
ESX.RegisterUsableItem('firebox', function(source)
|
||||||
|
local xPlayer = ESX.GetPlayerFromId(source)
|
||||||
|
|
||||||
|
xPlayer.removeInventoryItem('firebox', 1)
|
||||||
|
|
||||||
|
TriggerClientEvent('frobski-fireworks:start', source)
|
||||||
|
end)
|
Loading…
x
Reference in New Issue
Block a user