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)
|
||||
|
||||
-- Registriere Target für alle konfigurierten Shisha-Props
|
||||
-- Registriere Target für das funktionierende Shisha-Prop
|
||||
CreateThread(function()
|
||||
Wait(2000) -- Warte etwas länger, um sicherzustellen, dass alles geladen ist
|
||||
Debug("Registriere Target für Shisha-Props...")
|
||||
|
||||
-- Registriere alle konfigurierten Shisha-Props
|
||||
for _, propName in ipairs(Config.ShishaProps) do
|
||||
Debug("Versuche Target für Modell zu registrieren: " .. propName)
|
||||
-- Registriere das funktionierende Modell
|
||||
local workingModel = "sf_prop_sf_g_bong_01a"
|
||||
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
|
||||
local bongModel = "prop_bong_01"
|
||||
exports['qb-target']:AddTargetModel(bongModel, {
|
||||
exports['qb-target']:AddTargetModel(workingModel, {
|
||||
options = {
|
||||
{
|
||||
type = "client",
|
||||
|
@ -69,7 +37,27 @@ CreateThread(function()
|
|||
},
|
||||
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)
|
||||
|
||||
-- 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?
|
||||
Config.ShishaProps = {
|
||||
"sf_prop_sf_g_bong_01a",
|
||||
"sf_prop_sf_g_bong_01a", -- Funktionierendes Modell
|
||||
"prop_bong_01",
|
||||
-- Hier weitere Prop-Modelle hinzufügen
|
||||
}
|
||||
|
||||
-- Progressbar Dauer in ms
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue