-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathreport.lua
More file actions
82 lines (73 loc) · 2.72 KB
/
report.lua
File metadata and controls
82 lines (73 loc) · 2.72 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
70
71
72
73
74
75
76
77
78
79
80
81
82
if Config.Report == true then
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(100)
end
end)
RegisterNetEvent("finalmenuadmin:sendNotifForReport")
AddEventHandler("finalmenuadmin:sendNotifForReport", function(type, nomdumec, raisondumec)
if type == 1 then
ESX.TriggerServerCallback('BahFaut:getUsergroup', function(group)
playergroup = group
for k,v in pairs(Config.AdminRanks) do
if playergroup == v then
ESX.ShowNotification('~r~[REPORT]\n~o~Un nouveau report à été effectué !')
end
end
end)
elseif type == 2 then
ESX.TriggerServerCallback('BahFaut:getUsergroup', function(group)
playergroup = group
for k,v in pairs(Config.AdminRanks) do
if playergroup == v then
ESX.ShowNotification('Le report de ~b~'..nomdumec..'~s~ à été fermé !')
end
end
end)
end
end)
function ReportKeyBoardText(TextEntry, ExampleText, MaxStringLength)
AddTextEntry('FMMC_KEY_TIP1', TextEntry .. ':')
DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP1", "", ExampleText, "", "", "", MaxStringLength)
blockinput = true
while UpdateOnscreenKeyboard() ~= 1 and UpdateOnscreenKeyboard() ~= 2 do
Citizen.Wait(0)
end
if UpdateOnscreenKeyboard() ~= 2 then
local result = GetOnscreenKeyboardResult()
Citizen.Wait(500)
blockinput = false
return result
else
Citizen.Wait(500)
blockinput = false
return nil
end
end
function OuvrirReport()
local reportmenu = RageUI.CreateMenu("Report", "Intéractions")
reportmenu:SetRectangleBanner(255, 11, 11, 170)
RageUI.Visible(reportmenu, not RageUI.Visible(reportmenu))
while reportmenu do
Citizen.Wait(0)
RageUI.IsVisible(reportmenu, true, true, true, function()
RageUI.Separator("~r~Report ")
RageUI.ButtonWithStyle("Faire un report", nil, {RightLabel = "📋"}, true, function(Hovered, Active, Selected)
if (Selected) then
local raisonDuReport = KeyBoardText("Raison du report", "", 30)
TriggerServerEvent("finalmenuadmin:addreport", raisonDuReport)
RageUI.CloseAll()
ESX.ShowNotification("~g~Votre report à bien été envoyer.")
end
end)
end, function()
end)
if not RageUI.Visible(reportmenu) then
reportmenu = RMenu:DeleteType("Report", true)
end end end
RegisterCommand("report", function()
OuvrirReport()
end)
else return end