Basic gamemodes menu

This commit is contained in:
Jonny_Bro (Nikita) 2023-06-04 22:12:23 +05:00
parent a6665c4dfe
commit 45d0b8c868

View file

@ -211,7 +211,14 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function()
InfectionButton:SetText("Toggle Infection Gamemode") InfectionButton:SetText("Toggle Infection Gamemode")
InfectionButton:SetSize(0, 20) InfectionButton:SetSize(0, 20)
InfectionButton.DoClick = function() InfectionButton.DoClick = function()
if GetGlobalBool(GM_DATATHEFT) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end -- if GetGlobalBool(GM_DATATHEFT) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end
if GetGlobalBool(GM_DATATHEFT) then
InfectionButton:SetText("Another gamemode is running!")
timer.Simple(2, function()
InfectionButton:SetText("Toggle Infection Gamemode")
end)
return
end
StartInfection() StartInfection()
end end
@ -221,7 +228,14 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function()
DatatheftButton:SetText("Toggle Data Theft Gamemode") DatatheftButton:SetText("Toggle Data Theft Gamemode")
DatatheftButton:SetSize(0, 20) DatatheftButton:SetSize(0, 20)
DatatheftButton.DoClick = function() DatatheftButton.DoClick = function()
if GetGlobalBool(GM_INFECTION) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end -- if GetGlobalBool(GM_INFECTION) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end
if GetGlobalBool(GM_INFECTION) then
InfectionButton:SetText("Another gamemode is running!")
timer.Simple(2, function()
InfectionButton:SetText("Toggle Data Theft Gamemode")
end)
return
end
StartDataTheft() StartDataTheft()
end end