From 91e914a94d829792f5dca84fe6f9978c024d40d0 Mon Sep 17 00:00:00 2001 From: Linventif Date: Mon, 14 Aug 2023 10:04:50 +0000 Subject: [PATCH] chat cmd --- lua/gmod_integration/shared/sh_main.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lua/gmod_integration/shared/sh_main.lua b/lua/gmod_integration/shared/sh_main.lua index e561240..37ba444 100644 --- a/lua/gmod_integration/shared/sh_main.lua +++ b/lua/gmod_integration/shared/sh_main.lua @@ -3,4 +3,22 @@ function gmInte.log(msg, debug) if (debug && !gmInte.config.debug) then return end //format: [2021-08-01 00:00:00] [INFO] msg print("[" .. os.date("%Y-%m-%d %H:%M:%S") .. "] [Garry's Mod Integration] " .. msg) -end \ No newline at end of file +end + +// Chat Command + +local trigger = { + "link", + "gmint", + "gminte" +} + +hook.Add("OnPlayerChat", "gm_inte:con-chat", function(ply, strText, bTeam, bDead) + if (ply != LocalPlayer() ) then return end + + strText = string.sub(string.lower(strText ), 2) + if (table.HasValue(trigger, strText)) then + gui.OpenURL("https://gmod-integration.com") + return true + end +end) \ No newline at end of file