-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcl_rockstar.lua
More file actions
55 lines (47 loc) · 2.04 KB
/
Copy pathcl_rockstar.lua
File metadata and controls
55 lines (47 loc) · 2.04 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
-- [[ Initialize Menu ]] --
local menu = MenuV:CreateMenu(false, 'Rockstar Editor', 'topleft', 52, 180, 235, 'size-125', 'none', 'menuv', 'example_namespace')
slider = menu:AddSlider({ icon = '🎥', label = 'Option', value = 'option', values = {
{ label = Config.buttonRecord, value = 'record', description = '' },
{ label = Config.buttonSaveClip, value = 'saveclip', description = '' },
{ label = Config.buttonDelClip, value = 'delclip', description = '' },
{ label = Config.buttonEditor, value = 'editor', description = '' }
}})
slider:On('select', function(item, value)
TriggerEvent("nad_rockstar:"..value)
if Config.enableLogs == true then
TriggerServerEvent('nad_rockstar:log', value)
end
end)
-- [[ Register Events ]] --
RegisterNetEvent("nad_rockstar:record")
AddEventHandler("nad_rockstar:record", function()
StartRecording(1) -- https://docs.fivem.net/natives/?_0xC3AC2FFF9612AC81
notify(Config.record)
end)
RegisterNetEvent("nad_rockstar:saveclip")
AddEventHandler("nad_rockstar:saveclip", function()
StartRecording(0) -- https://docs.fivem.net/natives/?_0xC3AC2FFF9612AC81
StopRecordingAndSaveClip() -- https://docs.fivem.net/natives/?_0x071A5197D6AFC8B3
notify(Config.saveclip)
end)
RegisterNetEvent("nad_rockstar:delclip")
AddEventHandler("nad_rockstar:delclip", function()
StopRecordingAndDiscardClip() -- https://docs.fivem.net/natives/?_0x88BB3507ED41A240
notify(Config.delclip)
end)
RegisterNetEvent("nad_rockstar:editor")
AddEventHandler("nad_rockstar:editor", function()
notify(Config.editor)
NetworkSessionLeaveSinglePlayer() -- https://docs.fivem.net/natives/?_0x3442775428FD2DAA
ActivateRockstarEditor() -- https://docs.fivem.net/natives/?_0x49DA8145672B2725
end)
-- [[ Register Command ]] --
RegisterCommand(Config.command, function(source)
MenuV:OpenMenu(menu)
end, false)
-- [[ Functions ]] --
function notify(text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
DrawNotification(true, true)
end