1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-13 23:30:19 +02:00
parent 307f4c0d90
commit 1c16382e41
10 changed files with 307 additions and 2 deletions

View file

@ -163,14 +163,14 @@ AddEventHandler("chema_shisha:Drag", function()
local VapeFailure = math.random(1,99999)
if VapeFailure == 1 then
TaskPlayAnim(ped, ad, anim, 8.00, -8.00, -1, (2 + 16 + 32), 0.00, 0, 0, 0)
PlaySoundFrontend(-1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1)
TriggerServerEvent('InteractSound_SV:PlayOnSource', 'shisha_bubbling', 0.5)
Wait(250)
AddExplosion(PedPos.x, PedPos.y, PedPos.z+1.00, 34, 0.00, true, false, 1.00)
ApplyDamageToPed(ped, 200, false)
TriggerServerEvent("Vape:Failure", 0)
else
TaskPlayAnim(ped, ad, anim, 8.00, -8.00, -1, (2 + 16 + 32), 0.00, 0, 0, 0)
PlaySoundFrontend(-1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", 1)
TriggerServerEvent('InteractSound_SV:PlayOnSource', 'shisha_bubbling', 0.5)
Wait(950)
TriggerServerEvent("eff_smokes", PedToNet(ped))
Wait(1000)
@ -236,3 +236,28 @@ function DrawText3D(coords, text, size)
DrawText(x, y)
end
end
RegisterNetEvent("chema_shisha:deleteAll")
AddEventHandler("chema_shisha:deleteAll", function()
-- Delete all shishas in the area
for i = 1, #shisha do
local objectHash = shisha[i]
local radius = 100.0 -- Search in a 100.0 radius around the player
local ped = PlayerPedId()
local pos = GetEntityCoords(ped)
-- Find all objects of this type
local shishaObj = GetClosestObjectOfType(pos.x, pos.y, pos.z, radius, objectHash, false, false, false)
while DoesEntityExist(shishaObj) do
DeleteObject(shishaObj)
-- Look for the next one
shishaObj = GetClosestObjectOfType(pos.x, pos.y, pos.z, radius, objectHash, false, false, false)
end
end
-- Also delete any mobile hookahs that might be out
if DoesEntityExist(mobilehooka) then
DeleteObject(mobilehooka)
end
end)

View file

@ -12,3 +12,7 @@ client_scripts {
server_scripts {
'server.lua',
}
dependencies {
'interact-sound'
}

View file

@ -21,3 +21,14 @@ QBCore.Commands.Add("deleteshisha", "Lösche deine Shisha und bekomme sie zurüc
Player.Functions.AddItem("shisha", 1)
TriggerClientEvent('QBCore:Notify', source, 'Shisha entfernt und ins Inventar zurückgelegt', 'success')
end)
QBCore.Commands.Add("deleteallshishas", "Delete all placed shishas on the server (Admin Only)", {}, true, function(source)
local Player = QBCore.Functions.GetPlayer(source)
if Player.PlayerData.permission == "admin" or Player.PlayerData.permission == "god" then
TriggerClientEvent("chema_shisha:deleteAll", -1)
TriggerClientEvent('QBCore:Notify', source, 'All shishas have been deleted', 'success')
else
TriggerClientEvent('QBCore:Notify', source, 'You do not have permission to use this command', 'error')
end
end)