forked from leocroatian/fivem-purge
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclient.lua
More file actions
75 lines (66 loc) · 2.46 KB
/
client.lua
File metadata and controls
75 lines (66 loc) · 2.46 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
RegisterNetEvent('purge:start')
RegisterNetEvent('purge:stop')
local purgeActive = false
local count = 0
AddEventHandler('purge:start', function() -- initial purge start
CreateThread(function()
local scaleformHandle = RequestScaleformMovie("mp_big_message_freemode")
while not HasScaleformMovieLoaded(scaleformHandle) do
Citizen.Wait(0)
end
StartScreenEffect('DeathFailMPDark')
BeginScaleformMovieMethod(scaleformHandle, "SHOW_SHARD_WASTED_MP_MESSAGE")
PushScaleformMovieMethodParameterString("~r~Emergency Broadcast System")
PushScaleformMovieMethodParameterString("This is your Emergency Broadcast System announcing the commencement of the Annual Purge sanctioned by the U.S. Government")
EndScaleformMovieMethod()
SendNUIMessage({
transactionType = 'playSound',
transactionFile = 'purge',
transactionVolume = 0.5
})
while count ~= 1500 do -- wait 1000 counts and then stop drawing the purge text
DrawScaleformMovieFullscreen(scaleformHandle, 255, 255, 255, 255)
count = count + 1
Wait(0)
end
StopScreenEffect("DeathFailMPDark")
end)
end)
AddEventHandler('purge:start', function() -- handle the weather
CreateThread(function()
purgeActive = true
if purgeActive then
print('setting weather')
SetWeatherTypeNow('HALLOWEEN')
SetOverrideWeather('HALLOWEEN')
SetWeatherTypePersist('HALLOWEEN')
SetWeatherTypeNowPersist('HALLOWEEN')
SetArtificialLightsState(true)
SetArtificialLightsStateAffectsVehicles(true)
PauseClock(true)
print(tostring(GetWeatherTypeTransition()))
end
while true do
while purgeActive do
print('setting time')
NetworkOverrideClockTime(00, 00, 00)
SetClockTime(00, 00, 00)
Citizen.Wait(0)
end
Citizen.Wait(0)
end
end)
end)
AddEventHandler('purge:stop', function() -- handle the purge stopping
CreateThread(function()
purgeActive = false
count = 0
ClearOverrideWeather()
SetWeatherTypeNow("EXTRASUNNY")
SetOverrideWeather("EXTRASUNNY")
PauseClock(false)
NetworkOverrideClockTime(12, 00, 00)
SetClockTime(12, 00, 00)
SetArtificialLightsState(false)
end)
end)