1
1
include (" shared.lua" )
2
2
3
- surface .CreateFont (" BankFont " , {font = " Coolvetica" , size = 100 }) // I don ' t know why, but as long as this number is high the font looks fine!
3
+ surface .CreateFont (" bankFont " , {font = " Coolvetica" , size = 100 }) -- I don't know why, but as long as this number is high the font looks fine!
4
4
function ENT :Draw ()
5
5
local pos = self :GetPos ()
6
6
local ang = self :GetAngles ()
7
- local ang2 = self :GetAngles ()
7
+ local ang2 = self :GetAngles ()
8
8
9
- if ( not self .rotate ) then
9
+ if not self .rotate then
10
10
self .rotate = 0
11
11
end
12
12
13
- if ( not self .lasttime ) then
13
+ if not self .lasttime then
14
14
self .lasttime = 0
15
15
end
16
16
@@ -23,48 +23,56 @@ function ENT:Draw()
23
23
ang2 :RotateAroundAxis (ang2 :Right (), self .rotate + 180 )
24
24
25
25
cam .Start3D2D (pos , ang , 0.15 )
26
- draw .SimpleTextOutlined (DarkRP .formatMoney (self :GetNWInt (" CurrentReward " )), " BankFont " , 0 , - 480 , Color (20 , 150 , 20 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
26
+ draw .SimpleTextOutlined (DarkRP .formatMoney (self :GetNWInt (" bankReward " )), " bankFont " , 0 , - 485 , Color (20 , 150 , 20 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
27
27
28
- if ( self :GetNWString (" Status " ) == " " ) then
29
- draw .SimpleTextOutlined (" Bank Vault" , " BankFont " , 0 , - 560 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
28
+ if self :GetNWString (" bankStatus " ) == " " then
29
+ draw .SimpleTextOutlined (" Bank Vault" , " bankFont " , 0 , - 565 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
30
30
else
31
- draw .SimpleTextOutlined (" Bank Vault" , " BankFont " , 0 , - 635 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
32
- draw .SimpleTextOutlined (self :GetNWString (" Status " ), " BankFont " , 0 , - 560 , Color (255 , 9 , 9 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
31
+ draw .SimpleTextOutlined (" Bank Vault" , " bankFont " , 0 , - 640 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
32
+ draw .SimpleTextOutlined (self :GetNWString (" bankStatus " ), " bankFont " , 0 , - 565 , Color (255 , 9 , 9 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
33
33
end
34
34
cam .End3D2D ()
35
35
36
36
cam .Start3D2D (pos , ang2 , 0.15 )
37
- draw .SimpleTextOutlined (DarkRP .formatMoney (self :GetNWInt (" CurrentReward " )), " BankFont " , 0 , - 480 , Color (20 , 150 , 20 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
37
+ draw .SimpleTextOutlined (DarkRP .formatMoney (self :GetNWInt (" bankReward " )), " bankFont " , 0 , - 485 , Color (20 , 150 , 20 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
38
38
39
- if ( self :GetNWString (" Status " ) == " " ) then
40
- draw .SimpleTextOutlined (" Bank Vault" , " BankFont " , 0 , - 560 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
39
+ if self :GetNWString (" bankStatus " ) == " " then
40
+ draw .SimpleTextOutlined (" Bank Vault" , " bankFont " , 0 , - 565 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
41
41
else
42
- draw .SimpleTextOutlined (" Bank Vault" , " BankFont " , 0 , - 635 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
43
- draw .SimpleTextOutlined (self :GetNWString (" Status " ), " BankFont " , 0 , - 560 , Color (255 , 9 , 9 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
42
+ draw .SimpleTextOutlined (" Bank Vault" , " bankFont " , 0 , - 640 , Color (255 , 255 , 255 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
43
+ draw .SimpleTextOutlined (self :GetNWString (" bankStatus " ), " bankFont " , 0 , - 565 , Color (255 , 9 , 9 , 255 ), TEXT_ALIGN_CENTER , TEXT_ALIGN_CENTER , 5 , Color (0 , 0 , 0 , 255 ))
44
44
end
45
45
cam .End3D2D ()
46
46
47
- if ( self .rotate > 359 ) then
47
+ if self .rotate > 359 then
48
48
self .rotate = 0
49
49
end
50
50
51
51
self .rotate = self .rotate - 50 * (self .lasttime - CurTime ())
52
52
self .lasttime = CurTime ()
53
53
end
54
54
55
- hook .Add (" HUDPaint" , " BankRS_HUDWarn" , function ()
56
- for k , v in pairs (ents .FindByClass (" bank_vault" )) do
57
- if (string.find (v :GetNWString (" Status" ), " Robbing" ) and table .HasValue (BankRS_Config [" Robbery" ][" Team_Required" ][" Cops" ], team .GetName (LocalPlayer ():Team ()))) then
58
- local pos = (v :GetPos () + Vector (0 , 0 , 80 )):ToScreen ()
59
- draw .DrawText (v :GetNWString (" Status" ), " Default" , pos .x , pos .y , color_white , 1 )
60
- end
55
+ hook .Add (" HUDPaint" , " bank_draw_warning_hud" , function ()
56
+ if table .HasValue (bank_config .robbery .t_required .cops , team .GetName (LocalPlayer ():Team ())) then
57
+ for k , v in pairs (ents .FindByClass (" bank_vault" )) do
58
+ if string.find (v :GetNWString (" bankStatus" ), " Robbing" ) then
59
+ local pos = (v :GetPos () + Vector (0 , 0 , 80 )):ToScreen ()
60
+ draw .DrawText (v :GetNWString (" bankStatus" ), " Default" , pos .x , pos .y , color_white , 1 )
61
+ end
62
+ end
61
63
end
62
64
end )
63
65
64
- hook .Add (" PreDrawHalos" , " BankRS_HaloWarn" , function ()
65
- for k , v in pairs (ents .FindByClass (" bank_vault" )) do
66
- if (string.find (v :GetNWString (" Status" ), " Robbing" ) and table .HasValue (BankRS_Config [" Robbery" ][" Team_Required" ][" Cops" ], team .GetName (LocalPlayer ():Team ()))) then
67
- halo .Add ({v }, Color (150 , 20 , 20 ), 0 , 0 , 5 , true , true )
66
+ hook .Add (" PreDrawHalos" , " bank_draw_warning_halo" , function ()
67
+ if table .HasValue (bank_config .robbery .t_required .cops , team .GetName (LocalPlayer ():Team ())) then
68
+ local onRobbery = {}
69
+
70
+ for k , v in pairs (ents .FindByClass (" bank_vault" )) do
71
+ if string.find (v :GetNWString (" bankStatus" ), " Robbing" ) then
72
+ table.insert (onRobbery , v )
73
+ end
68
74
end
75
+
76
+ halo .Add (onRobbery , Color (150 , 20 , 20 ), 0 , 0 , 5 , true , true )
69
77
end
70
78
end )
0 commit comments