MsgHook TypeSet

Hook function types for user messages.

function Action(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init)

Called when a bit buffer based usermessage is hooked

Parameters

msg_id

Message index.

msg

Handle to the input bit buffer.

players

Array containing player indexes.

playersNum

Number of players in the array.

reliable

True if message is reliable, false otherwise.

init

True if message is an initmsg, false otherwise.

return

Ignored for normal hooks. For intercept hooks, Plugin_Handled blocks the message from being sent, and Plugin_Continue resumes normal functionality.

function Action(UserMsg msg_id, Protobuf msg, const int[] players, int playersNum, bool reliable, bool init)

Called when a protobuf based usermessage is hooked

Parameters

msg_id

Message index.

msg

Handle to the input protobuf.

players

Array containing player indexes.

playersNum

Number of players in the array.

reliable

True if message is reliable, false otherwise.

init

True if message is an initmsg, false otherwise.

return

Ignored for normal hooks. For intercept hooks, Plugin_Handled blocks the message from being sent, and Plugin_Continue resumes normal functionality.