-
Notifications
You must be signed in to change notification settings - Fork 40
/
Server.lua
70 lines (58 loc) · 2.53 KB
/
Server.lua
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
-------------------- Strez Tsunami --------------------
local QBCore = exports['qb-core']:GetCoreObject()
-------------------- Gloabl Player Emails --------------------
-- Emergency Email
QBCore.Commands.Add('emergencyemail', 'Send emergency email to everyone', {{name = 'Email', help = 'Text of Email'}}, true, function(source, args)
local msg = table.concat(args, ' ')
local len = tonumber(string.len(msg))
if len <= 255 then
TriggerClientEvent('strez:client:SendEmergencyEmail', -1, msg)
else
TriggerClientEvent('QBCore:Notify', source, 'Exceeds maximum characters!', 'error')
end
end, 'god')
-- Announcement Email
QBCore.Commands.Add('announcementemail', 'Send announcement email to everyone', {{name = 'Email', help = 'Text of Email'}}, true, function(source, args)
local msg = table.concat(args, ' ')
local len = tonumber(string.len(msg))
if len <= 255 then
TriggerClientEvent('strez:client:SendAnnouncementEmail', -1, msg)
else
TriggerClientEvent('QBCore:Notify', source, 'Exceeds maximum characters!', 'error')
end
end, 'god')
-------------------- Manual Tsunami Restart --------------------
-- Manual 15 Minute Tsunami Warning
QBCore.Commands.Add('tsunamimanual', '15 minute tsuanami warning', {}, true, function(source, args)
TriggerClientEvent('strez:client:TsunamiManual', -1)
end, 'god')
-------------------- Tsunami Showcase --------------------
-- Tsunami Showcase
QBCore.Commands.Add('tsunamishowcase', 'Tsunami Showcase Command', {}, true, function(source, args)
TriggerClientEvent('strez:client:TsunamiShowcase', -1)
end, 'god')
-------------------- TxAdmin Auto Restart Tsunami --------------------
-- 30 minutes Reminder
AddEventHandler('txAdmin:events:scheduledRestart', function(eventData)
if eventData.secondsRemaining == 1800 then
TriggerClientEvent('strez:client:SendMailTsunamiAuto30', -1)
end
end)
-- 15 Minutes Reminder
AddEventHandler('txAdmin:events:scheduledRestart', function(eventData)
if eventData.secondsRemaining == 900 then
TriggerClientEvent('strez:client:SendMailTsunamiAuto15', -1)
end
end)
-- 5 Minutes Reminder
AddEventHandler('txAdmin:events:scheduledRestart', function(eventData)
if eventData.secondsRemaining == 300 then
TriggerClientEvent('strez:client:SendMailTsunamiAuto5', -1)
end
end)
-- 1 Minutes Reminder
AddEventHandler('txAdmin:events:scheduledRestart', function(eventData)
if eventData.secondsRemaining == 60 then
TriggerClientEvent('strez:client:SendMailTsunamiAuto1', -1)
end
end)