1.1 --- a/plugins/include/usermessages.inc Thu Mar 01 16:35:06 2007 +0000
1.2 +++ b/plugins/include/usermessages.inc Thu Mar 01 22:49:08 2007 +0000
1.3 @@ -85,6 +85,7 @@
1.4 * @brief Called when a message is hooked
1.5 *
1.6 * @param msg_id Message index.
1.7 + * @param bf Handle to the input bit buffer of the message.
1.8 * @param players Array containing player indexes.
1.9 * @param playersNum Number of players in the array.
1.10 * @param reliable True if message is reliable, false otherwise.
1.11 @@ -92,7 +93,14 @@
1.12 * @return Ignored for normal hooks. For intercept hooks, false blocks
1.13 * the message from being sent, and true continues.
1.14 */
1.15 -functag MsgHook bool:public(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init);
1.16 +functag MsgHook Action:public(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init);
1.17 +
1.18 +/**
1.19 + * @brief Called when a message is finished sending.
1.20 + *
1.21 + * @param msg_id Message index.
1.22 + */
1.23 +functag MsgSentNotify public(UserMsg:msg_id);
1.24
1.25 /**
1.26 * @brief Hooks a user message.
1.27 @@ -102,10 +110,11 @@
1.28 * @param intercept If intercept is true, message will be fully intercepted,
1.29 * allowing the user to block the message. Otherwise,
1.30 * the hook is normal and ignores the return value.
1.31 + * @param notify Notification function.
1.32 * @noreturn
1.33 * @error Invalid message index.
1.34 */
1.35 -native HookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false);
1.36 +native HookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false, MsgSentNotify:notify=MsgSentNotify:-1);
1.37
1.38 /**
1.39 * @brief Removes one usermessage hook.
1.40 @@ -119,33 +128,6 @@
1.41 native UnHookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false);
1.42
1.43 /**
1.44 - * @brief Called when a message is finished sending.
1.45 - *
1.46 - * @param msg_id Message index.
1.47 - */
1.48 -functag MsgSentNotify public(UserMsg:msg_id);
1.49 -
1.50 -/**
1.51 - * @brief Notifies when a message has finished sending.
1.52 - *
1.53 - * @param msg_id Message index.
1.54 - * @param notify Notification function.
1.55 - * @noreturn
1.56 - * @error Invalid message index.
1.57 - */
1.58 -native NotifyUserMessage(UserMsg:msg_id, MsgSentNotify:notify);
1.59 -
1.60 -/**
1.61 - * @brief Removes a user message notification.
1.62 - *
1.63 - * @param msg_id Message index.
1.64 - * @param notify Notification function.
1.65 - * @noreturn
1.66 - * @error Invalid message index.
1.67 - */
1.68 -native RemoveNotifyUserMessage(UserMsg:msg_id, MsgSentNotify:notify);
1.69 -
1.70 -/**
1.71 * Starts a usermessage (network message) that broadcasts to all clients.
1.72 * @note See StartMessage or StartMessageEx().
1.73 *