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! An example on how to use PHP for hooks can be found [http://7daystodie.com/forums/showthread.php?11184-Native-Linux-server-(with-management-scripts)&p=128726&viewfull=1#post128726 on the forum]. 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 1. Client IP }}} {{{#!td align=left * [/attachment/wiki/Hooks/greet.sh greet.sh] * [/attachment/wiki/Hooks/greet_sayplayer.sh greet_sayplayer.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 }}} |-------------------------------- {{{#!td align=left remoteCommand }}} {{{#!td align=left After a command was executed from a client }}} {{{#!td align=left 1. Instance name 1. Executed command 1. Player name }}} {{{#!td align=left }}} |-------------------------------- {{{#!td align=left telnetCommand }}} {{{#!td align=left After a command was executed from a telnet session }}} {{{#!td align=left 1. Instance name 1. Executed command 1. Client IP }}} {{{#!td align=left }}}