lua/lua/gmod_integration/server/sv_hook.lua

41 lines
950 B
Lua
Raw Normal View History

2023-08-09 05:04:43 +00:00
//
2023-09-25 09:14:50 +00:00
// Server Hooks
2023-08-09 05:04:43 +00:00
//
hook.Add("ShutDown", "gmInte:Server:ShutDown", function()
2023-09-20 15:23:20 +00:00
gmInte.serverShutDown()
2023-08-09 05:04:43 +00:00
end)
2023-09-20 15:23:20 +00:00
2023-08-09 05:04:43 +00:00
hook.Add("Initialize", "gmInte.sendStatus", function()
timer.Simple(1, function()
2023-09-20 15:23:20 +00:00
gmInte.serverStart()
2023-08-09 05:04:43 +00:00
gmInte.sendStatus()
end)
end)
2023-09-20 15:23:20 +00:00
//
2023-09-25 09:14:50 +00:00
// Player Hooks
2023-09-20 15:23:20 +00:00
//
2023-08-09 05:04:43 +00:00
gameevent.Listen("player_connect")
hook.Add("player_connect", "gmInte:Player:Connect", function(data)
gmInte.playerConnect(data)
2023-09-23 14:27:20 +00:00
gmInte.playerFilter(data)
2023-08-09 05:04:43 +00:00
end)
2023-09-20 15:23:20 +00:00
2023-09-23 14:36:43 +00:00
gameevent.Listen("server_addban")
hook.Add("server_addban", "gmInte:Player:Ban", function(data)
gmInte.playerBan(data)
end)
2023-08-09 05:04:43 +00:00
hook.Add("PlayerDisconnected", "gmInte:Player:Disconnect", function(ply)
gmInte.playerDisconnected(ply)
end)
2023-09-20 15:23:20 +00:00
2023-08-09 05:04:43 +00:00
hook.Add("onPlayerChangedName", "gmInte:PlayerChangeName", function(ply, old, new)
gmInte.playerChangeName(ply, old, new)
2023-09-20 15:23:20 +00:00
end)
hook.Add("PlayerSay", "gmInte:PlayerSay", function(ply, text, team)
gmInte.playerSay(ply, text, team)
2023-08-09 05:04:43 +00:00
end)