-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.lua
88 lines (64 loc) · 2.2 KB
/
client.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Citizen.CreateThread(function()
if Config.EnableJoinTransition then
local cloudOpacity = 0.01
local muteSound = true
function ToggleSound(state)
if state then
StartAudioScene("MP_LEADERBOARD_SCENE");
else
StopAudioScene("MP_LEADERBOARD_SCENE");
end
end
function InitialSetup()
SetManualShutdownLoadingScreenNui(true)
ToggleSound(muteSound)
if not IsPlayerSwitchInProgress() then
SwitchOutPlayer(PlayerPedId(), 0, 1)
end
end
function ClearScreen()
SetCloudHatOpacity(cloudOpacity)
HideHudAndRadarThisFrame()
SetDrawOrigin(0.0, 0.0, 0.0, 0)
end
InitialSetup()
Citizen.CreateThread(function()
InitialSetup()
while GetPlayerSwitchState() ~= 5 do
Citizen.Wait(0)
ClearScreen()
end
ShutdownLoadingScreen()
ClearScreen()
Citizen.Wait(0)
DoScreenFadeOut(0)
ShutdownLoadingScreenNui()
ClearScreen()
Citizen.Wait(0)
ClearScreen()
DoScreenFadeIn(500)
while not IsScreenFadedIn() do
Citizen.Wait(0)
ClearScreen()
end
local timer = GetGameTimer()
ToggleSound(false)
while true do
ClearScreen()
Citizen.Wait(0)
if GetGameTimer() - timer > 5000 then
SwitchInPlayer(PlayerPedId())
ClearScreen()
while GetPlayerSwitchState() ~= 12 do
Citizen.Wait(0)
ClearScreen()
end
break
end
end
ClearDrawOrigin()
end)
else
return
end
end)