TTT has some Lua hooks of its own, besides the default GMod hooks
. They are used in the same way.
TTTPrepareRound (no parameters)
Called when the "Preparing" phase begins.
TTTBeginRound (no parameters)
Called when Traitors/Detectives have been selected and the round is active.
Called when the round ends. The "result" parameter will be equal to one of the values: WIN_TRAITOR, WIN_INNOCENT or WIN_TIMELIMIT. So if result == WIN_TRAITOR, the Traitors have won the round.
The "result" parameter currently only exists on the server even though the hook is shared. It will always be nil on the client. If you need the round result on the client, you will have to send it yourself.
TTTDelayRoundStartForVote (no parameters)
Called just before starting the Preparation phase. If this hook returns true, the start of that phase will be delayed by 30 seconds. You can use this for custom map voting systems and such. By default it is used to prevent new rounds from starting while a vote is occurring.
Called to determine what colour a player's name should be on the scoreboard. Hence, it must return a Color object, or return nil (or nothing at all). The "ply" parameter contains a player object, so you can for example check the player's SteamID and give certain people a special colour. Note that TTT also uses this hook for the default colours, so you should return nil for players that you do not want to do anything special with.
TTTPlayerColor (no parameters)
Called to determine what colour the playermodels should be for the upcoming round. Return a Color object. The default implementation uses the ttt_playercolor_mode convar, so if you use this hook this any colour you return will override that setting (returning nil will allow the default code to run).
TTTPlayerRadioCommand (ply, cmd_name, cmd_target)
Called when a player tries to use a quickchat/radio command. If this hook returns true, the command will not be sent, ie. it will get blocked. You can use this for anti-spam measures or to replace or modify a message. The "ply" parameter is of course the player using the command, "cmd_name" is the identifier of the command (such as "quick_yes" for the "Yes." command), and "cmd_target" is the target part of the command (an entity index if it's a player or identified corpse, an identifier like "quick_nobody" if not).
Called when a player is about to be kicked/banned because their karma has gone below the the autokick/ban level specified in the server's configuration. Return false to prevent the player from being kicked/banned. Karma is checked at the end of a round, so if their karma continues to be low, this hook will be called after every round.
Called after TTT's settings window has been created. The "dtabs" parameter is a DPropertySheet panel object you can use to add your own tab to the settings window.
TTTOrderedEquipment (ply, equipment, is_item)
Called when a player has bought a piece of equipment. The "equipment" parameter will be either the weapon classname (e.g., "weapon_ttt_knife") or an item ID (eg. EQUIP_ARMOR). The "is_item" parameter tells you which one it is.
TTTFoundDNA (ply, dna_owner, ent)
Called when a player finds the DNA of "dna_owner" on the entity "ent" (most likely a corpse, but can be a weapon).