rewrite to qbcore

This commit is contained in:
2024-07-02 19:52:50 -05:00
parent a599a81677
commit 53577c533d
7 changed files with 99 additions and 68 deletions

18
server/sv_main.lua Normal file
View File

@ -0,0 +1,18 @@
print("[frp-fireworks] Starting resource...")
QBCore = exports['qb-core']:GetCoreObject()
if QBCore == nil then
print("[!] QBCore is not installed (failed to get core object). This resource requires QBCore to function properly. Shutting down resource...")
Citizen.Wait(5000)
StopResource(GetCurrentResourceName())
end
-- Create our command to use fireworks. Only allow people with the frp.useFireworks permission to use this command.
QBCore.Commands.Add("fireworks", "Trigger a firework show!", {}, false, function(source, args)
local Player = QBCore.Functions.GetPlayer(source)
TriggerClientEvent('frp-fireworks:client:UseFirework', source)
TriggerClientEvent('QBCore:Notify', source, "Starting the show...", "success")
end, 'admin')
print("[frp-fireworks] Done!")
print("[frp-fireworks] Resource started successfully!")