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

View file

@ -34,7 +34,7 @@ Citizen.CreateThread(function()
local loc = vector3(shishaPos.x, shishaPos.y, shishaPos.z)
if not buyad then
DrawText3D(vector3(shishaPos.x, shishaPos.y, shishaPos.z+1), "[~y~E~w~] Shisha Rauchen (10€)", 0.7)
DrawText3D(vector3(shishaPos.x, shishaPos.y, shishaPos.z+1), "[~y~E~w~] Shisha Rauchen", 0.7)
end
-- Start Session
@ -43,7 +43,6 @@ Citizen.CreateThread(function()
buyad = true
sessionStarted = true
endCallback = true
--QBCore.Functions.Notify("You've started a session and paid 20$.", "success")
ShishaFunctions()
TriggerEvent("chema_shisha:anim")
@ -58,12 +57,10 @@ Citizen.CreateThread(function()
helmet = true
TriggerServerEvent("chema_shisha:pay")
Citizen.CreateThread(function()
while true do
if sessionStarted == true then
DrawText3D(vector3(shishaPos.x, shishaPos.y, shishaPos.z+0.4), "~b~\"H\"~c~ Rauchen.", 0.7)
DrawText3D(vector3(shishaPos.x, shishaPos.y, shishaPos.z+0.4), "~b~\"E\"~c~ Rauchen.", 0.7)
DrawText3D(loc, "~b~\"F\"~c~ Sitzung beenden.", 0.7)
end
Citizen.Wait(0)
@ -83,7 +80,7 @@ Citizen.CreateThread(function()
while true do
local ped = GetPlayerPed(-1)
Citizen.Wait(0)
if IsControlJustPressed(0, 74) then -- Normal: H
if IsControlJustPressed(0, 38) then -- E statt H
TriggerEvent("chema_shisha:Drag", PedToNet(ped))
TriggerEvent("chema_shisha:Drag", 0)
end
@ -94,11 +91,9 @@ Citizen.CreateThread(function()
buyad = false
DeleteObject(VapeMod)
DeleteObject(VapeMod)
DeleteObject(mobilehooka)
ClearPedTasksImmediately(ped)
ClearPedSecondaryTask(ped)
TriggerEvent("chema_shisha:delete", -1, entity)
--QBCore.Functions.Notify("You ended the session.", "error")
endCallback = false
end
end
@ -198,7 +193,6 @@ AddEventHandler("chema_shisha:delete", function(source)
local loc = vector3(shishaPos.x, shishaPos.y, shishaPos.z)
DeleteObject(mobilehooka)
--QBCore.Functions.Notify("The hookah was taken down.", "success")
else
Citizen.Wait(500)
end
@ -207,7 +201,6 @@ end)
RegisterNetEvent("chema_shisha:spawn")
AddEventHandler("chema_shisha:spawn", function(source, xPlayer)
--QBCore.Functions.Notify("The session has started", "success")
local playerPed = GetPlayerPed(-1)
local coords = GetEntityCoords(playerPed)

View file

@ -1,13 +1,5 @@
local QBCore = exports['qb-core']:GetCoreObject()
RegisterNetEvent("chema_shisha:pay")
AddEventHandler("chema_shisha:pay", function(entity)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.RemoveMoney("cash", 20, "shisha-session")
end)
RegisterServerEvent("eff_smokes")
AddEventHandler("eff_smokes", function(entity)
TriggerClientEvent("c_eff_smokes", -1, entity)
@ -17,21 +9,15 @@ QBCore.Functions.CreateUseableItem('shisha', function(source, item)
local Player = QBCore.Functions.GetPlayer(source)
if Player.Functions.RemoveItem(item.name, 1, item.slot) then
TriggerClientEvent('QBCore:Notify', source, 'The shisha was set up.', 'success')
TriggerClientEvent('QBCore:Notify', source, 'Die Shisha wurde aufgebaut.', 'success')
TriggerClientEvent("chema_shisha:spawn", -1, entity)
end
end)
QBCore.Commands.Add("deleteshisha", "Delete your shisha and get it back in inventory", {}, false, function(source)
QBCore.Commands.Add("deleteshisha", "Lösche deine Shisha und bekomme sie zurück ins Inventar", {}, false, function(source)
local Player = QBCore.Functions.GetPlayer(source)
TriggerClientEvent("chema_shisha:delete", -1, entity)
Player.Functions.AddItem("shisha", 1)
TriggerClientEvent('QBCore:Notify', source, 'Shisha removed and returned to inventory', 'success')
end)
QBCore.Commands.Add("shisha", "Spawn a shisha", {}, false, function(source)
local Player = QBCore.Functions.GetPlayer(source)
TriggerClientEvent("chema_shisha:spawn", -1, entity, Player)
TriggerClientEvent('QBCore:Notify', source, 'Shisha entfernt und ins Inventar zurückgelegt', 'success')
end)