From a06ece834e37e4b9df6f74057ee18ce7d7cd6cc3 Mon Sep 17 00:00:00 2001 From: Linventif Date: Wed, 20 Sep 2023 17:23:20 +0200 Subject: [PATCH] add chat sync to discord --- lua/gmod_integration/server/sv_hook.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lua/gmod_integration/server/sv_hook.lua b/lua/gmod_integration/server/sv_hook.lua index d5cb9cd..e6db344 100644 --- a/lua/gmod_integration/server/sv_hook.lua +++ b/lua/gmod_integration/server/sv_hook.lua @@ -1,26 +1,36 @@ // -// Hooks +// Server // -// Server hook.Add("ShutDown", "gmInte:Server:ShutDown", function() - gmInte.serverShutDown(ply) + gmInte.serverShutDown() end) -// set convar sv_hibernate_think to 1 + hook.Add("Initialize", "gmInte.sendStatus", function() timer.Simple(1, function() + gmInte.serverStart() gmInte.sendStatus() end) end) +// // Player +// + gameevent.Listen("player_connect") + hook.Add("player_connect", "gmInte:Player:Connect", function(data) gmInte.playerConnect(data) end) + hook.Add("PlayerDisconnected", "gmInte:Player:Disconnect", function(ply) gmInte.playerDisconnected(ply) end) + hook.Add("onPlayerChangedName", "gmInte:PlayerChangeName", function(ply, old, new) gmInte.playerChangeName(ply, old, new) +end) + +hook.Add("PlayerSay", "gmInte:PlayerSay", function(ply, text, team) + gmInte.playerSay(ply, text, team) end) \ No newline at end of file