2014-08-04 12:12:15 +00:00
|
|
|
// vim: set ts=4 sw=4 tw=99 noet:
|
|
|
|
//
|
|
|
|
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
|
|
|
// Copyright (C) The AMX Mod X Development Team.
|
|
|
|
//
|
|
|
|
// This software is licensed under the GNU General Public License, version 3 or higher.
|
|
|
|
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
|
|
|
// https://alliedmods.net/amxmodx-license
|
|
|
|
|
|
|
|
//
|
|
|
|
// Message Functions
|
|
|
|
//
|
2006-05-11 08:36:20 +00:00
|
|
|
|
|
|
|
#if defined _coremsg_included
|
|
|
|
#endinput
|
|
|
|
#endif
|
|
|
|
#define _coremsg_included
|
|
|
|
|
2006-05-17 20:08:04 +00:00
|
|
|
#include <message_const>
|
2006-05-11 08:36:20 +00:00
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Marks the beginning of a client message.
|
|
|
|
*
|
|
|
|
* @note You may generate menus, smoke, shockwaves, thunderlights,
|
|
|
|
* intermission and many other messages.
|
|
|
|
* @note For a list of HL game events, visit https://wiki.alliedmods.net/Half-Life_1_Game_Events
|
|
|
|
* @note For a list of HL engine messages, visit https://wiki.alliedmods.net/Half-Life_1_Engine_Messages
|
|
|
|
* @note You may also refer to the messages_const.inc file for examples.
|
|
|
|
* @note Each message starts with a message_begin() or message_begin_f() function
|
|
|
|
* and ends with message_end(). The specific message arguments go in between
|
|
|
|
* these two by using the write_*() functions found in messages.inc.
|
|
|
|
*
|
|
|
|
* @param dest Destination type (see MSG_* constants in messages_const.inc)
|
|
|
|
* @param msg_type Message id
|
|
|
|
* @param origin Message origin
|
|
|
|
* @param player Client index receiving the message or 0 for all clients
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message id is specified or an invalid number
|
|
|
|
* of parameters is passed, an error will be thrown.
|
|
|
|
*/
|
2007-01-26 05:56:10 +00:00
|
|
|
native message_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Marks the beginning of a client message.
|
|
|
|
*
|
|
|
|
* @note You may generate menus, smoke, shockwaves, thunderlights,
|
|
|
|
* intermission and many other messages.
|
|
|
|
* @note For a list of HL game events, visit https://wiki.alliedmods.net/Half-Life_1_Game_Events
|
|
|
|
* @note For a list of HL engine messages, visit https://wiki.alliedmods.net/Half-Life_1_Engine_Messages
|
|
|
|
* @note You may also refer to the messages_const.inc file for examples.
|
|
|
|
* @note This function is the same as message_begin(), but the origin
|
|
|
|
* argument accepts only float values in this one.
|
|
|
|
* @note Each message starts with a message_begin() or message_begin_f() function
|
|
|
|
* and ends with message_end(). The specific message arguments go in between
|
|
|
|
* these two by using the write_*() functions found in messages.inc.
|
|
|
|
*
|
|
|
|
* @param dest Destination type (see MSG_* constants in messages_const.inc)
|
|
|
|
* @param msg_type Message id
|
|
|
|
* @param origin Message origin
|
|
|
|
* @param player Client index receiving the message or 0 for all clients
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message id is specified or an invalid number
|
|
|
|
* of parameters is passed, an error will be thrown.
|
|
|
|
*/
|
2013-08-10 08:22:38 +00:00
|
|
|
native message_begin_f(dest, msg_type, const Float:origin[3] = {0.0,0.0,0.0}, player = 0);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ends a message that was started with message_begin() or message_begin_f().
|
|
|
|
*
|
|
|
|
* @note If the function is called without using message_begin() or
|
|
|
|
* message_begin_f() first, the server will crash immediately.
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native message_end();
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single byte to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Byte to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native write_byte(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single character to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Character to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native write_char(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single number to a message (short).
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Number to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native write_short(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single number to a message (long).
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Number to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native write_long(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes an entity index to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Entity index to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native write_entity(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes an angle entry to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Angle to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native write_angle(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes an angle entry to a message using a float value.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Angle to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2013-08-10 08:22:38 +00:00
|
|
|
native write_angle_f(Float:x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a coordinate entry to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Coordinate to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-05-17 20:08:04 +00:00
|
|
|
native write_coord(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a coordinate entry to a message using a float value.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Coordinate to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2013-08-10 08:22:38 +00:00
|
|
|
native write_coord_f(Float:x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a string to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a message_begin()
|
|
|
|
* or message_begin_f() and a message_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x String to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2007-01-26 05:56:10 +00:00
|
|
|
native write_string(const x[]);
|
2006-05-11 08:36:20 +00:00
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Marks the beginning of a client message.
|
|
|
|
*
|
|
|
|
* @note You may generate menus, smoke, shockwaves, thunderlights,
|
|
|
|
* intermission and many other messages.
|
|
|
|
* @note For a list of HL game events, visit https://wiki.alliedmods.net/Half-Life_1_Game_Events
|
|
|
|
* @note For a list of HL engine messages, visit https://wiki.alliedmods.net/Half-Life_1_Engine_Messages
|
|
|
|
* @note You may also refer to the messages_const.inc file for examples.
|
|
|
|
* @note This function is the same as message_begin(), except that the messages
|
|
|
|
* sent with this one are also sent to all other AMXX and Metamod plugins.
|
|
|
|
* This means that if you send one of these messages, other plugins will
|
|
|
|
* be notified of that message, which was previously impossible.
|
|
|
|
* @note BE CAREFUL! Using this incorrectly, or not for its intended purpose,
|
|
|
|
* could cause infinite recursion or something just as bad!
|
|
|
|
* @note Each message starts with a emessage_begin() or emessage_begin_f() function
|
|
|
|
* and ends with emessage_end(). The specific message arguments go in between
|
|
|
|
* these two by using the ewrite_*() functions found in messages.inc.
|
|
|
|
*
|
|
|
|
* @param dest Destination type (see MSG_* constants in messages_const.inc)
|
|
|
|
* @param msg_type Message id
|
|
|
|
* @param origin Message origin
|
|
|
|
* @param player Client index receiving the message or 0 for all clients
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message id is specified or an invalid number
|
|
|
|
* of parameters is passed, an error will be thrown.
|
2006-06-28 10:01:55 +00:00
|
|
|
*/
|
2007-01-26 05:56:10 +00:00
|
|
|
native emessage_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Marks the beginning of a client message.
|
|
|
|
*
|
|
|
|
* @note You may generate menus, smoke, shockwaves, thunderlights,
|
|
|
|
* intermission and many other messages.
|
|
|
|
* @note For a list of HL game events, visit https://wiki.alliedmods.net/Half-Life_1_Game_Events
|
|
|
|
* @note For a list of HL engine messages, visit https://wiki.alliedmods.net/Half-Life_1_Engine_Messages
|
|
|
|
* @note You may also refer to the messages_const.inc file for examples.
|
|
|
|
* @note This function is the same as message_begin_f(), except that the messages
|
|
|
|
* sent with this one are also sent to all other AMXX and Metamod plugins.
|
|
|
|
* This means that if you send one of these messages, other plugins will
|
|
|
|
* be notified of that message, which was previously impossible.
|
|
|
|
* @note BE CAREFUL! Using this incorrectly, or not for its intended purpose,
|
|
|
|
* could cause infinite recursion or something just as bad!
|
|
|
|
* @note This function is the same as emessage_begin(), but the origin
|
|
|
|
* argument accepts only float values in this one.
|
|
|
|
* @note Each message starts with a emessage_begin() or emessage_begin_f() function
|
|
|
|
* and ends with emessage_end(). The specific message arguments go in between
|
|
|
|
* these two by using the ewrite_*() functions found in messages.inc.
|
|
|
|
*
|
|
|
|
* @param dest Destination type (see MSG_* constants in messages_const.inc)
|
|
|
|
* @param msg_type Message id
|
|
|
|
* @param origin Message origin
|
|
|
|
* @param player Client index receiving the message or 0 for all clients
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message id is specified or an invalid number
|
|
|
|
* of parameters is passed, an error will be thrown.
|
|
|
|
*/
|
2013-08-10 08:22:38 +00:00
|
|
|
native emessage_begin_f(dest, msg_type, const Float:origin[3] = {0.0,0.0,0.0}, player = 0);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ends a message that was started with emessage_begin() or emessage_begin_f().
|
|
|
|
*
|
|
|
|
* @note If the function is called without using emessage_begin() or
|
|
|
|
* emessage_begin_f() first, the server will crash immediately.
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native emessage_end();
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single byte to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Byte to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native ewrite_byte(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single character to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Character to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native ewrite_char(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single number to a message (short).
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Number to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native ewrite_short(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a single number to a message (long).
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Number to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native ewrite_long(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes an entity index to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Entity index to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native ewrite_entity(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes an angle entry to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Angle to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native ewrite_angle(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes an angle entry to a message using a float value.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Angle to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2013-08-10 08:22:38 +00:00
|
|
|
native ewrite_angle_f(Float:x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a coordinate entry to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Coordinate to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2006-06-28 10:01:55 +00:00
|
|
|
native ewrite_coord(x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a coordinate entry to a message using a float value.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x Coordinate to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2013-08-10 08:22:38 +00:00
|
|
|
native ewrite_coord_f(Float:x);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes a string to a message.
|
|
|
|
*
|
|
|
|
* @note This function should only be used in between a emessage_begin()
|
|
|
|
* or emessage_begin_f() and a emessage_end() function. Trying to use
|
|
|
|
* it outside of these functions will crash the server immediately.
|
|
|
|
*
|
|
|
|
* @param x String to write
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
*/
|
2007-01-26 05:56:10 +00:00
|
|
|
native ewrite_string(const x[]);
|
2006-06-28 10:01:55 +00:00
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Sets whether or not an engine message will be blocked.
|
|
|
|
*
|
|
|
|
* @note For a list of message flags, have a look at the BLOCK_* constants
|
|
|
|
* in message_const.inc.
|
|
|
|
*
|
|
|
|
* @param iMessage Message id
|
|
|
|
* @param iMessageFlags BLOCK_* constant
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message id is specified, an error
|
|
|
|
* will be thrown.
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native set_msg_block(iMessage, iMessageFlags);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets whether or not an engine message is blocked.
|
|
|
|
*
|
|
|
|
* @param iMessage Message id
|
|
|
|
*
|
|
|
|
* @return BLOCK_* constant
|
|
|
|
* @error If an invalid message id is specified, an error
|
|
|
|
* will be thrown.
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native get_msg_block(iMessage);
|
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Lets you directly hook a message in the engine.
|
|
|
|
*
|
|
|
|
* @note The function is called in the following manner:
|
|
|
|
* msg_id - Message id
|
|
|
|
* msg_dest - Destination type (see MSG_* constants in messages_const.inc)
|
|
|
|
* msg_entity - Entity receiving the message
|
|
|
|
*
|
|
|
|
* @note You can overwrite the message before anything happens by using the
|
|
|
|
* set_msg_arg_* functions and either let the message continue by
|
|
|
|
* returning PLUGIN_CONTINUE or fully block it with PLUGIN_HANDLED.
|
|
|
|
* @note If you hook a message, the message is stored but not sent. You have
|
|
|
|
* the opportunity to not only execute code, but to get/set the contents
|
|
|
|
* of the message before you choose to either block it or let it go on
|
|
|
|
* its way.
|
|
|
|
* @note The return value can be passed to unregister_message() in order to
|
|
|
|
* stop the message from being hooked.
|
|
|
|
*
|
|
|
|
* @param iMsgId Message id
|
|
|
|
* @param szFunction Function that will be called
|
|
|
|
*
|
|
|
|
* @return Id that can be passed to unregister_message() on
|
|
|
|
* success, or 0 if an invalid message id is passed
|
|
|
|
* @error If the specified function can't be found, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2007-01-26 05:56:10 +00:00
|
|
|
native register_message(iMsgId, const szFunction[]);
|
2006-05-11 08:36:20 +00:00
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Unregisters a message hook previously created with register_message().
|
|
|
|
*
|
|
|
|
* @note You must pass the proper message id and return value from the
|
|
|
|
* message to unregister the message successfully.
|
|
|
|
*
|
|
|
|
* @param iMsgId Message id
|
|
|
|
* @param registeredmsg Registered message id
|
|
|
|
*
|
|
|
|
* @return Id that can again be passed to register_message() on
|
|
|
|
* success, or 0 if an invalid message id is passed
|
|
|
|
* @error If an invalid registered message handle is passed, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2008-04-29 02:18:39 +00:00
|
|
|
native unregister_message(iMsgId, registeredmsg);
|
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Gets number of arguments that were passed to a message.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @return Number of arguments
|
2006-05-11 08:36:20 +00:00
|
|
|
*/
|
|
|
|
native get_msg_args();
|
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Gets the argument type of a specified argument.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param argn Argument number
|
|
|
|
*
|
|
|
|
* @return Argument type (see ARG_* constants in message_const.inc)
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native get_msg_argtype(argn);
|
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Gets the integer value of a specified argument.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param argn Argument number
|
|
|
|
*
|
|
|
|
* @return Argument value as an integer
|
|
|
|
* @error If an invalid message argument is passed, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native get_msg_arg_int(argn);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the float value of a specified argument.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param argn Argument number
|
|
|
|
*
|
|
|
|
* @return Argument value as a float
|
|
|
|
* @error If an invalid message argument is passed, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native Float:get_msg_arg_float(argn);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the string value from a specified argument.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param argn Argument number
|
|
|
|
* @param szReturn Buffer to store the value in
|
|
|
|
* @param iLength Maximum buffer length
|
|
|
|
*
|
|
|
|
* @return String length
|
|
|
|
* @error If an invalid message argument is passed, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native get_msg_arg_string(argn, szReturn[], iLength);
|
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Sets the integer value of a specified argument.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param argn Argument number
|
|
|
|
* @param argtype Argument type (see ARG_* constants in message_const.inc)
|
|
|
|
* @param iValue Argument value
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message argument is passed, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native set_msg_arg_int(argn, argtype, iValue);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the float value of a specified argument.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param argn Argument number
|
|
|
|
* @param argtype Argument type (see ARG_* constants in message_const.inc)
|
|
|
|
* @param fValue Argument value
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message argument is passed, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2006-05-11 08:36:20 +00:00
|
|
|
native set_msg_arg_float(argn, argtype, Float:fValue);
|
2018-08-20 17:49:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the string value of a specified argument.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param argn Argument number
|
|
|
|
* @param szString Argument value
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If an invalid message argument is passed, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2007-01-26 05:56:10 +00:00
|
|
|
native set_msg_arg_string(argn, const szString[]);
|
2006-05-11 08:36:20 +00:00
|
|
|
|
2018-08-20 17:49:47 +00:00
|
|
|
/**
|
|
|
|
* Gets the origin of a message.
|
|
|
|
*
|
|
|
|
* @note This function will fail if used outside a hooked message scope, thus
|
|
|
|
* it should never be used unless inside a registered message function.
|
|
|
|
*
|
|
|
|
* @param _Origin Array to store the origin in
|
|
|
|
*
|
|
|
|
* @noreturn
|
|
|
|
* @error If the function is used outside a message hook, an
|
|
|
|
* error will be thrown.
|
|
|
|
*/
|
2007-01-26 05:56:10 +00:00
|
|
|
native get_msg_origin(const Float:_Origin[3]);
|