Creating your own hooks

Hi
I’m wondering how I would go about adding my own hooks

so for example if I have a function called ChangeTeam( ply, team )

I would like to be able to do

hook.Add( “ChangeTeam”, “notify team members”, function() blah blah end )

hook.Call

ninja’d

Inside your ChangeTeam(ply, team) function add a line somewhat like:


hook.Call("ChangeTeam", GAMEMODE, ply, team)

And then you can use like


hook.Add("ChangeTeam", "PlayerChangedTeam", function(ply, team) /* do stuff */ end)