Repository navigation
Expand file tree
/
Copy pathcommands.lua
More file actions
69 lines (61 loc) · 3.09 KB
/
Copy pathcommands.lua
File metadata and controls
69 lines (61 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--[[
/$$ /$$ /$$
| $$ | $$ | $$
| $$$$$$$ /$$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ | $$ /$$$$$$ /$$$$$$ /$$$$$$/$$$$
| $$__ $$| $$ | $$ /$$__ $$ /$$__ $$|____ $$ /$$$$$$|____ $$| $$ |____ $$ /$$__ $$| $$_ $$_ $$
| $$ \ $$| $$ | $$| $$ | $$| $$ \__/ /$$$$$$$|______/ /$$$$$$$| $$ /$$$$$$$| $$ \__/| $$ \ $$ \ $$
| $$ | $$| $$ | $$| $$ | $$| $$ /$$__ $$ /$$__ $$| $$ /$$__ $$| $$ | $$ | $$ | $$
| $$ | $$| $$$$$$$| $$$$$$$| $$ | $$$$$$$ | $$$$$$$| $$| $$$$$$$| $$ | $$ | $$ | $$
|__/ |__/ \____ $$ \_______/|__/ \_______/ \_______/|__/ \_______/|__/ |__/ |__/ |__/
/$$ | $$
| $$$$$$/
\______/
--]]
---@return nil
RegisterCommand(Config.StopAllAlarmsCommand or 'stopallalarms', function()
local result = lib.callback.await('hydra_alarm:stopAllAlarms', false)
if result and result.ok then
if Framework and Framework.Client and Framework.Client.Notification then
Framework.Client.Notification('Hydra Alarm', result.message or L('command.stopall.success'), 'success', 4000)
end
return
end
if Framework and Framework.Client and Framework.Client.Notification then
Framework.Client.Notification('Hydra Alarm', (result and result.message) or L('command.stopall.denied'), 'error', 4500)
end
end, false)
-- Debug command: lock/unlock nearby vehicle
if Config.Debug then
RegisterCommand('togglevehiclelock', function()
local playerCoords = GetEntityCoords(PlayerPedId())
local nearbyVehicles = lib.getNearbyVehicles(playerCoords, 10, true)
if not nearbyVehicles or #nearbyVehicles == 0 then
if Framework and Framework.Client and Framework.Client.Notification then
Framework.Client.Notification('DEBUG', 'No nearby vehicles found.', 'error', 3000)
end
return
end
local vehicle = nearbyVehicles[1].vehicle
if not DoesEntityExist(vehicle) then
if Framework and Framework.Client and Framework.Client.Notification then
Framework.Client.Notification('DEBUG', 'Vehicle does not exist.', 'error', 3000)
end
return
end
local currentLockStatus = GetVehicleDoorLockStatus(vehicle)
local isLocked = currentLockStatus > 1
if isLocked then
SetVehicleDoorsLocked(vehicle, 1)
SetVehicleDoorsLockedForAllPlayers(vehicle, false)
if Framework and Framework.Client and Framework.Client.Notification then
Framework.Client.Notification('DEBUG', 'Vehicle unlocked.', 'success', 2500)
end
else
SetVehicleDoorsLocked(vehicle, 2)
SetVehicleDoorsLockedForAllPlayers(vehicle, true)
if Framework and Framework.Client and Framework.Client.Notification then
Framework.Client.Notification('DEBUG', 'Vehicle locked.', 'success', 2500)
end
end
end, false)
end