-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsh_hardcore_minigame.lua
61 lines (53 loc) · 1.51 KB
/
sh_hardcore_minigame.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
if SERVER then
AddCSLuaFile()
end
MINIGAME.author = "Alf21"
MINIGAME.contact = "TTT2 Discord"
if CLIENT then
MINIGAME.lang = {
name = {
en = "Hardcore Minigame",
de = "Hardcore Minispiel",
fr = "Mini-jeu Hardcore",
ru = "Хардкорная мини-игра"
},
desc = {
en = "Try to win without some essential HUD elements.",
de = "Versuche ohne ein paar wichtige HUD Elemente zu gewinnen.",
fr = "Essayez de gagner sans certains éléments importants de votre interface.",
ru = "Попробуйте выиграть без некоторых важных элементов в вашем интерфейсе."
}
}
local ignoreHUDElems = {
TTTTargetID = true,
tttdrowning = true,
tttminiscoreboard = true,
tttsidebar = true
}
function MINIGAME:OnActivation()
hook.Add("HUDShouldDraw", "TTT2MGHardcore", function(elem)
local client = LocalPlayer()
if client:Alive() and client:IsTerror() and ignoreHUDElems[elem] then
return false
end
end)
-- prevent radio commands
hook.Add("TTT2ClientRadioCommand", "TTT2MGHardcore", function()
return true
end)
end
function MINIGAME:OnDeactivation()
hook.Remove("HUDShouldDraw", "TTT2MGHardcore")
hook.Remove("TTT2ClientRadioCommand", "TTT2MGHardcore")
end
else
function MINIGAME:OnActivation()
-- prevent radio commands
hook.Add("TTTPlayerRadioCommand", "TTT2MGHardcore", function()
return true
end)
end
function MINIGAME:OnDeactivation()
hook.Remove("TTTPlayerRadioCommand", "TTT2MGHardcore")
end
end