Hooks
Server hooks allow you to intervene in the internal processes of High Phone
General
createHook
Creates a hook for a specified action. You can also return false
in some hooks to cancel the action!
Arguments
Name | Type | Description |
---|---|---|
name | Hook | Hook name |
callback | function | Callback function |
Example
Hooks
beforeCreatePhone
Gets called before the phone is inserted into the database, which means you can inject your own data.
Function Parameters
Name | Type | Description |
---|---|---|
src | number | Player source |
data | PhoneData | Phone data |
Example
afterCreatePhone
Gets called after the phone is inserted into the database. Use for tasks that don't inject any data, as it will not get updated in the database.
Function Parameters
Name | Type | Description |
---|---|---|
src | number | Player source |
data | PhoneData | Phone data |
Example
startCall
Gets called when a player starts a phone call.
Function Parameters
Name | Type | Description |
---|---|---|
src | number | Player source |
call | PhoneCall | Call data |
Example
endCall
Gets called when a phone call is ended.
Function Parameters
Name | Type | Description |
---|---|---|
src | number | Player source |
call | PhoneCall | Call data |
Example
sendMessage
Gets called when a message is sent, that includes server-sent messages.
Function Parameters
Name | Type | Description |
---|---|---|
src? | number | Player source if not sent from the server |
message | MessageData | Message data |
Example
Last updated on