forked from Simnation/Main
Update main.lua
This commit is contained in:
parent
52924f74cd
commit
8df30ff398
1 changed files with 16 additions and 4 deletions
|
@ -374,7 +374,7 @@ local function switchSeat(vehicle, newSeatIndex)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Tür-Kontrollfunktion
|
-- Tür-Kontrollfunktion (korrigierte Version)
|
||||||
local function controlDoor(vehicle, doorIndex)
|
local function controlDoor(vehicle, doorIndex)
|
||||||
if GetVehicleDoorAngleRatio(vehicle, doorIndex) > 0.0 then
|
if GetVehicleDoorAngleRatio(vehicle, doorIndex) > 0.0 then
|
||||||
SetVehicleDoorShut(vehicle, doorIndex, false)
|
SetVehicleDoorShut(vehicle, doorIndex, false)
|
||||||
|
@ -383,9 +383,12 @@ local function controlDoor(vehicle, doorIndex)
|
||||||
SetVehicleDoorOpen(vehicle, doorIndex, false, false)
|
SetVehicleDoorOpen(vehicle, doorIndex, false, false)
|
||||||
QBCore.Functions.Notify('Tür geöffnet', 'success')
|
QBCore.Functions.Notify('Tür geöffnet', 'success')
|
||||||
end
|
end
|
||||||
|
-- Menü nach kurzer Verzögerung neu öffnen, damit die Benachrichtigung sichtbar ist
|
||||||
|
Wait(100)
|
||||||
|
showDoorControlMenu(vehicle)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Fenster-Kontrollfunktion
|
-- Fenster-Kontrollfunktion (korrigierte Version)
|
||||||
local function controlWindow(vehicle, windowIndex)
|
local function controlWindow(vehicle, windowIndex)
|
||||||
if IsVehicleWindowIntact(vehicle, windowIndex) then
|
if IsVehicleWindowIntact(vehicle, windowIndex) then
|
||||||
RollDownWindow(vehicle, windowIndex)
|
RollDownWindow(vehicle, windowIndex)
|
||||||
|
@ -394,6 +397,9 @@ local function controlWindow(vehicle, windowIndex)
|
||||||
RollUpWindow(vehicle, windowIndex)
|
RollUpWindow(vehicle, windowIndex)
|
||||||
QBCore.Functions.Notify('Fenster geschlossen', 'success')
|
QBCore.Functions.Notify('Fenster geschlossen', 'success')
|
||||||
end
|
end
|
||||||
|
-- Menü nach kurzer Verzögerung neu öffnen, damit die Benachrichtigung sichtbar ist
|
||||||
|
Wait(100)
|
||||||
|
showWindowControlMenu(vehicle)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Extras-Kontrollfunktion
|
-- Extras-Kontrollfunktion
|
||||||
|
@ -409,7 +415,7 @@ local function controlExtra(vehicle, extraId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Türen-Kontrollmenü
|
-- Türen-Kontrollmenü (korrigierte Version)
|
||||||
function showDoorControlMenu(vehicle)
|
function showDoorControlMenu(vehicle)
|
||||||
local options = {
|
local options = {
|
||||||
{
|
{
|
||||||
|
@ -425,6 +431,9 @@ function showDoorControlMenu(vehicle)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
QBCore.Functions.Notify('Alle Türen umgeschaltet', 'success')
|
QBCore.Functions.Notify('Alle Türen umgeschaltet', 'success')
|
||||||
|
-- Menü nach kurzer Verzögerung neu öffnen
|
||||||
|
Wait(100)
|
||||||
|
showDoorControlMenu(vehicle)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -494,7 +503,7 @@ function showDoorControlMenu(vehicle)
|
||||||
lib.showContext('vehicle_door_menu')
|
lib.showContext('vehicle_door_menu')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Fenster-Kontrollmenü
|
-- Fenster-Kontrollmenü (korrigierte Version)
|
||||||
function showWindowControlMenu(vehicle)
|
function showWindowControlMenu(vehicle)
|
||||||
local options = {
|
local options = {
|
||||||
{
|
{
|
||||||
|
@ -510,6 +519,9 @@ function showWindowControlMenu(vehicle)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
QBCore.Functions.Notify('Alle Fenster umgeschaltet', 'success')
|
QBCore.Functions.Notify('Alle Fenster umgeschaltet', 'success')
|
||||||
|
-- Menü nach kurzer Verzögerung neu öffnen
|
||||||
|
Wait(100)
|
||||||
|
showWindowControlMenu(vehicle)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue