forked from Simnation/Main
fix
This commit is contained in:
parent
c5cf83125b
commit
29f3962a74
2 changed files with 27 additions and 40 deletions
|
@ -17,48 +17,16 @@ CreateThread(function()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Registriere Target für alle konfigurierten Shisha-Props
|
-- Registriere Target für das funktionierende Shisha-Prop
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
Wait(2000) -- Warte etwas länger, um sicherzustellen, dass alles geladen ist
|
Wait(2000) -- Warte etwas länger, um sicherzustellen, dass alles geladen ist
|
||||||
Debug("Registriere Target für Shisha-Props...")
|
Debug("Registriere Target für Shisha-Props...")
|
||||||
|
|
||||||
-- Registriere alle konfigurierten Shisha-Props
|
-- Registriere das funktionierende Modell
|
||||||
for _, propName in ipairs(Config.ShishaProps) do
|
local workingModel = "sf_prop_sf_g_bong_01a"
|
||||||
Debug("Versuche Target für Modell zu registrieren: " .. propName)
|
Debug("Registriere Target für funktionierendes Modell: " .. workingModel)
|
||||||
|
|
||||||
-- Methode 1: Mit String-Namen
|
|
||||||
exports['qb-target']:AddTargetModel(propName, {
|
|
||||||
options = {
|
|
||||||
{
|
|
||||||
type = "client",
|
|
||||||
event = "nordi_shisha:client:OpenMenu",
|
|
||||||
icon = 'fas fa-smoking',
|
|
||||||
label = 'Shisha rauchen',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
distance = 2.0
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Methode 2: Mit Hash (für zusätzliche Sicherheit)
|
|
||||||
local modelHash = GetHashKey(propName)
|
|
||||||
exports['qb-target']:AddTargetModel(modelHash, {
|
|
||||||
options = {
|
|
||||||
{
|
|
||||||
type = "client",
|
|
||||||
event = "nordi_shisha:client:OpenMenu",
|
|
||||||
icon = 'fas fa-smoking',
|
|
||||||
label = 'Shisha rauchen',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
distance = 2.0
|
|
||||||
})
|
|
||||||
|
|
||||||
Debug("Target für Modell registriert: " .. propName .. " (Hash: " .. modelHash .. ")")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Zusätzlich explizit prop_bong_01 registrieren, da es häufig verwendet wird
|
exports['qb-target']:AddTargetModel(workingModel, {
|
||||||
local bongModel = "prop_bong_01"
|
|
||||||
exports['qb-target']:AddTargetModel(bongModel, {
|
|
||||||
options = {
|
options = {
|
||||||
{
|
{
|
||||||
type = "client",
|
type = "client",
|
||||||
|
@ -69,7 +37,27 @@ CreateThread(function()
|
||||||
},
|
},
|
||||||
distance = 2.0
|
distance = 2.0
|
||||||
})
|
})
|
||||||
Debug("Target für Standard-Bong registriert: " .. bongModel)
|
|
||||||
|
Debug("Target für Modell registriert: " .. workingModel)
|
||||||
|
|
||||||
|
-- Versuche auch andere Modelle zu registrieren
|
||||||
|
for _, propName in ipairs(Config.ShishaProps) do
|
||||||
|
if propName ~= workingModel then
|
||||||
|
Debug("Versuche zusätzliches Modell zu registrieren: " .. propName)
|
||||||
|
|
||||||
|
exports['qb-target']:AddTargetModel(propName, {
|
||||||
|
options = {
|
||||||
|
{
|
||||||
|
type = "client",
|
||||||
|
event = "nordi_shisha:client:OpenMenu",
|
||||||
|
icon = 'fas fa-smoking',
|
||||||
|
label = 'Shisha rauchen',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
distance = 2.0
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Event Handler für das Öffnen des Menüs
|
-- Event Handler für das Öffnen des Menüs
|
||||||
|
|
|
@ -5,9 +5,8 @@ Config.DebugPoly = false -- Auf true setzen, um Box-Zonen zu sehen
|
||||||
|
|
||||||
-- Welche Props sollen als Shisha funktionieren?
|
-- Welche Props sollen als Shisha funktionieren?
|
||||||
Config.ShishaProps = {
|
Config.ShishaProps = {
|
||||||
"sf_prop_sf_g_bong_01a",
|
"sf_prop_sf_g_bong_01a", -- Funktionierendes Modell
|
||||||
"prop_bong_01",
|
"prop_bong_01",
|
||||||
-- Hier weitere Prop-Modelle hinzufügen
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Progressbar Dauer in ms
|
-- Progressbar Dauer in ms
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue