-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.lua
108 lines (87 loc) · 2.66 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
--==--==--==--==--
--Info--
--==--==--==--==--
-- Cinematic Cam by Blythe. #3133
-- Feel free to edit this script as you wish however do **NOT** make a re-release without permission from yours truly
-- Enjoy!
--==--==--==--==--
--Config--
--==--==--==--==--
CinematicCamCommand = "CinematicCam" -- [[The name of the command called to toggle the cinematic cam]]
CinematicCamMaxHeight = 0.4 -- [[The height of the rects. Keep below 1 and keep as a float however I recommend you keep it as it is as this is the best height I could find]]
--DO NOT CHANGE BELOW THIS LINE--
--==--==--==--==--
--Variables--
--==--==--==--==--
CinematicCamBool = false
w = 0
--==--==--==--==--
--Command--
--==--==--==--==--
RegisterCommand(CinematicCamCommand, function()
CinematicCamBool = not CinematicCamBool
CinematicCamDisplay(CinematicCamBool)
end)
--==--==--==--==--
--Main Thread--
--==--==--==--==--
Citizen.CreateThread(function() -- [[Requests the minimap scaleform and actually calls the rect function allong with the hud components function.]]
minimap = RequestScaleformMovie("minimap")
if not HasScaleformMovieLoaded(minimap) then
RequestScaleformMovie(minimap)
while not HasScaleformMovieLoaded(minimap) do
Wait(1)
end
end
while true do
Citizen.Wait(1)
if w > 0 then
DrawRects()
end
if CinematicCamBool then
DESTROYHudComponents()
end
end
end)
--==--==--==--==--
--Functions--
--==--==--==--==--
function DESTROYHudComponents() -- [[Get rid of all active hud components.]]
for i = 0, 22, 1 do
if IsHudComponentActive(i) then
HideHudComponentThisFrame(i)
end
end
end
function DrawRects() -- [[Draw the Black Rects]]
DrawRect(0.0, 0.0, 2.0, w, 0, 0, 0, 255)
DrawRect(0.0, 1.0, 2.0, w, 0, 0, 0, 255)
end
function DisplayHealthArmour(int) -- [[Thanks to GlitchDetector for this function.]]
BeginScaleformMovieMethod(minimap, "SETUP_HEALTH_ARMOUR")
ScaleformMovieMethodAddParamInt(int)
EndScaleformMovieMethod()
end
function CinematicCamDisplay(bool) -- [[Handles Displaying Radar, Body Armour and the rects themselves.]]
SetRadarBigmapEnabled(true, false)
Wait(0)
SetRadarBigmapEnabled(false, false)
if bool then
DisplayRadar(false)
DisplayHealthArmour(3)
for i = 0, CinematicCamMaxHeight, 0.01 do
Wait(10)
w = i
end
else
DisplayRadar(true)
DisplayHealthArmour(0)
for i = CinematicCamMaxHeight, 0, -0.01 do
Wait(10)
w = i
end
end
end
--==--==--==--==--
--END :(--
--==--==--==--==--