Hooks are a way to add additional behaviour to the scripts. They are basically custom scripts that are called upon specific events. For example one could define a hook which is called on player connects and then send a message in the in-game chat to greet the new player. All hooks have to executable files in ''SDTD_BASE/hooks//.sh''. The folder '''' has to be in exactly the same case as the hook name column in the table below shows it. If you want to use the functions of the management scripts in your hook you can add this to the start of your script: {{{ #!/bin/bash . /usr/local/lib/7dtd/common.sh }}} An example can be found in the greet.sh hook for playerConnect. Note that you have to use Bash as interpreter for your script if you want to use the script functions! If you think a hook for another event could be interesting please [/newticket create a ticket] or [[Author|contact me]]. Currently the following hooks are defined: {{{#!th align=center Hook name }}} {{{#!th align=center Called on event }}} {{{#!th align=center Passed parameters }}} {{{#!th align=center Examples }}} |-------------------------------- {{{#!td align=left playerConnect }}} {{{#!td align=left After a player has connected }}} {{{#!td align=left rowspan=2 1. Instance name 1. Player ID 1. Entity ID 1. Nickname 1. Steam ID }}} {{{#!td align=left * [/attachment/wiki/Hooks/greet.sh greet.sh] }}} |-------------------------------- {{{#!td align=left playerDisconnect }}} {{{#!td align=left After a player has disconnected }}} {{{#!td align=left }}} |-------------------------------- {{{#!td align=left serverPreStart }}} {{{#!td align=left Before an instance is started }}} {{{#!td align=left rowspan=4 1. Instance name }}} {{{#!td align=left }}} |-------------------------------- {{{#!td align=left serverPostStart }}} {{{#!td align=left After an instance was started }}} {{{#!td align=left }}} |-------------------------------- {{{#!td align=left serverPreStop }}} {{{#!td align=left Before an instance is stopped }}} {{{#!td align=left }}} |-------------------------------- {{{#!td align=left serverPostStop }}} {{{#!td align=left After an instance was stopped }}} {{{#!td align=left * [/attachment/wiki/Hooks/backup.sh backup.sh] }}} |-------------------------------- {{{#!td align=left backup }}} {{{#!td align=left After a backup was created }}} {{{#!td align=left 1. Path of new backup folder }}} {{{#!td align=left }}} |-------------------------------- {{{#!td align=left chat }}} {{{#!td align=left After message was sent in the chat }}} {{{#!td align=left 1. Instance name 1. Message including player name }}} {{{#!td align=left }}}