forked from Simnation/Main
ed
This commit is contained in:
parent
d271b73053
commit
307f4c0d90
2 changed files with 6 additions and 27 deletions
|
@ -34,7 +34,7 @@ Citizen.CreateThread(function()
|
||||||
local loc = vector3(shishaPos.x, shishaPos.y, shishaPos.z)
|
local loc = vector3(shishaPos.x, shishaPos.y, shishaPos.z)
|
||||||
|
|
||||||
if not buyad then
|
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
|
end
|
||||||
|
|
||||||
-- Start Session
|
-- Start Session
|
||||||
|
@ -43,7 +43,6 @@ Citizen.CreateThread(function()
|
||||||
buyad = true
|
buyad = true
|
||||||
sessionStarted = true
|
sessionStarted = true
|
||||||
endCallback = true
|
endCallback = true
|
||||||
--QBCore.Functions.Notify("You've started a session and paid 20$.", "success")
|
|
||||||
ShishaFunctions()
|
ShishaFunctions()
|
||||||
TriggerEvent("chema_shisha:anim")
|
TriggerEvent("chema_shisha:anim")
|
||||||
|
|
||||||
|
@ -58,12 +57,10 @@ Citizen.CreateThread(function()
|
||||||
|
|
||||||
helmet = true
|
helmet = true
|
||||||
|
|
||||||
|
|
||||||
TriggerServerEvent("chema_shisha:pay")
|
|
||||||
Citizen.CreateThread(function()
|
Citizen.CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
if sessionStarted == true then
|
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)
|
DrawText3D(loc, "~b~\"F\"~c~ Sitzung beenden.", 0.7)
|
||||||
end
|
end
|
||||||
Citizen.Wait(0)
|
Citizen.Wait(0)
|
||||||
|
@ -83,7 +80,7 @@ Citizen.CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
local ped = GetPlayerPed(-1)
|
local ped = GetPlayerPed(-1)
|
||||||
Citizen.Wait(0)
|
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", PedToNet(ped))
|
||||||
TriggerEvent("chema_shisha:Drag", 0)
|
TriggerEvent("chema_shisha:Drag", 0)
|
||||||
end
|
end
|
||||||
|
@ -94,11 +91,9 @@ Citizen.CreateThread(function()
|
||||||
buyad = false
|
buyad = false
|
||||||
DeleteObject(VapeMod)
|
DeleteObject(VapeMod)
|
||||||
DeleteObject(VapeMod)
|
DeleteObject(VapeMod)
|
||||||
DeleteObject(mobilehooka)
|
|
||||||
ClearPedTasksImmediately(ped)
|
ClearPedTasksImmediately(ped)
|
||||||
ClearPedSecondaryTask(ped)
|
ClearPedSecondaryTask(ped)
|
||||||
TriggerEvent("chema_shisha:delete", -1, entity)
|
TriggerEvent("chema_shisha:delete", -1, entity)
|
||||||
--QBCore.Functions.Notify("You ended the session.", "error")
|
|
||||||
endCallback = false
|
endCallback = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -198,7 +193,6 @@ AddEventHandler("chema_shisha:delete", function(source)
|
||||||
local loc = vector3(shishaPos.x, shishaPos.y, shishaPos.z)
|
local loc = vector3(shishaPos.x, shishaPos.y, shishaPos.z)
|
||||||
|
|
||||||
DeleteObject(mobilehooka)
|
DeleteObject(mobilehooka)
|
||||||
--QBCore.Functions.Notify("The hookah was taken down.", "success")
|
|
||||||
else
|
else
|
||||||
Citizen.Wait(500)
|
Citizen.Wait(500)
|
||||||
end
|
end
|
||||||
|
@ -207,7 +201,6 @@ end)
|
||||||
|
|
||||||
RegisterNetEvent("chema_shisha:spawn")
|
RegisterNetEvent("chema_shisha:spawn")
|
||||||
AddEventHandler("chema_shisha:spawn", function(source, xPlayer)
|
AddEventHandler("chema_shisha:spawn", function(source, xPlayer)
|
||||||
--QBCore.Functions.Notify("The session has started", "success")
|
|
||||||
local playerPed = GetPlayerPed(-1)
|
local playerPed = GetPlayerPed(-1)
|
||||||
local coords = GetEntityCoords(playerPed)
|
local coords = GetEntityCoords(playerPed)
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
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")
|
RegisterServerEvent("eff_smokes")
|
||||||
AddEventHandler("eff_smokes", function(entity)
|
AddEventHandler("eff_smokes", function(entity)
|
||||||
TriggerClientEvent("c_eff_smokes", -1, entity)
|
TriggerClientEvent("c_eff_smokes", -1, entity)
|
||||||
|
@ -17,21 +9,15 @@ QBCore.Functions.CreateUseableItem('shisha', function(source, item)
|
||||||
local Player = QBCore.Functions.GetPlayer(source)
|
local Player = QBCore.Functions.GetPlayer(source)
|
||||||
|
|
||||||
if Player.Functions.RemoveItem(item.name, 1, item.slot) then
|
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)
|
TriggerClientEvent("chema_shisha:spawn", -1, entity)
|
||||||
end
|
end
|
||||||
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)
|
local Player = QBCore.Functions.GetPlayer(source)
|
||||||
|
|
||||||
TriggerClientEvent("chema_shisha:delete", -1, entity)
|
TriggerClientEvent("chema_shisha:delete", -1, entity)
|
||||||
Player.Functions.AddItem("shisha", 1)
|
Player.Functions.AddItem("shisha", 1)
|
||||||
TriggerClientEvent('QBCore:Notify', source, 'Shisha removed and returned to inventory', 'success')
|
TriggerClientEvent('QBCore:Notify', source, 'Shisha entfernt und ins Inventar zurückgelegt', '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)
|
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue