chatmanager.inc
Original include source with line numbers.
| 1 | #if defined _chatmanager_included |
| 2 | #endinput |
| 3 | #endif |
| 4 | |
| 5 | #define _chatmanager_included |
| 6 | |
| 7 | /** |
| 8 | * Returns the flags needed to see all chats. |
| 9 | * |
| 10 | * @param buffer Buffer to store the flags in. |
| 11 | * @param len Maximum buffer length. |
| 12 | * @noreturn |
| 13 | */ |
| 14 | native cm_get_admin_listen_flags(buffer[], len) |
| 15 | |
| 16 | /** |
| 17 | * Finds a chat color by a specified number. |
| 18 | * |
| 19 | * @param num Color number. |
| 20 | * @param buffer Buffer to store the chat color in. |
| 21 | * @param len Maximum buffer length. |
| 22 | * @return 1 if found, 0 otherwise. |
| 23 | */ |
| 24 | native cm_get_chat_color_by_num(num, buffer[], len) |
| 25 | |
| 26 | /** |
| 27 | * Finds a prefix by a specified number. |
| 28 | * |
| 29 | * @param num Prefix number. |
| 30 | * @param buffer Buffer to store the prefix in. |
| 31 | * @param len Maximum buffer length. |
| 32 | * @return 1 if found, 0 otherwise. |
| 33 | */ |
| 34 | native cm_get_prefix_by_num(num, buffer[], len) |
| 35 | |
| 36 | /** |
| 37 | * Returns the client's chat color. |
| 38 | * |
| 39 | * @param id Player's index. |
| 40 | * @param buffer Buffer to store the chat color in. |
| 41 | * @param len Maximum buffer length. |
| 42 | * @noreturn |
| 43 | */ |
| 44 | native cm_get_user_chat_color(id, buffer[], len) |
| 45 | |
| 46 | /** |
| 47 | * Checks whether the client's color chat is enabled or disabled. |
| 48 | * |
| 49 | * @param id Player's index. |
| 50 | * @return True if it's enabled, false otherwise. |
| 51 | */ |
| 52 | native bool:cm_get_user_chat_color_status(id) |
| 53 | |
| 54 | /** |
| 55 | * Returns the client's custom name. |
| 56 | * |
| 57 | * @param id Player's index. |
| 58 | * @param buffer Buffer to store the custom name in. |
| 59 | * @param len Maximum buffer length. |
| 60 | * @noreturn |
| 61 | */ |
| 62 | native cm_get_user_custom_name(id, buffer[], len) |
| 63 | |
| 64 | /** |
| 65 | * Checks whether the client's custom name is enabled or disabled. |
| 66 | * |
| 67 | * @param id Player's index. |
| 68 | * @return True if it's enabled, false otherwise. |
| 69 | */ |
| 70 | native bool:cm_get_user_custom_name_status(id) |
| 71 | |
| 72 | /** |
| 73 | * Returns the client's prefix. |
| 74 | * |
| 75 | * @param id Player's index. |
| 76 | * @param buffer Buffer to store the prefix in. |
| 77 | * @param len Maximum buffer length. |
| 78 | * @noreturn |
| 79 | */ |
| 80 | native cm_get_user_prefix(id, buffer[], len) |
| 81 | |
| 82 | /** |
| 83 | * Checks whether the client's prefix is enabled or disabled. |
| 84 | * |
| 85 | * @param id Player's index. |
| 86 | * @return True if it's enabled, false otherwise. |
| 87 | */ |
| 88 | native bool:cm_get_user_prefix_status(id) |
| 89 | |
| 90 | /** |
| 91 | * Checks if the client has admin listen (can see all chats). |
| 92 | * |
| 93 | * @param id Player's index. |
| 94 | * @return True if he has, false otherwise. |
| 95 | */ |
| 96 | native bool:cm_has_user_admin_listen(id) |
| 97 | |
| 98 | /** |
| 99 | * Reloads the configuration file. |
| 100 | * |
| 101 | * @noreturn |
| 102 | */ |
| 103 | native cm_reload_config_file() |
| 104 | |
| 105 | /** |
| 106 | * Sets a temporary chat color on the client. |
| 107 | * |
| 108 | * @note The chat color set with this native won't get saved in the .ini file, so it will be gone after the client's data is updated. |
| 109 | * |
| 110 | * @param id Player's index. |
| 111 | * @param color Temporary chat color. |
| 112 | * @noreturn |
| 113 | */ |
| 114 | native cm_set_user_chat_color(id, color[]) |
| 115 | |
| 116 | /** |
| 117 | * Enables/Disables the client's color chat. |
| 118 | * |
| 119 | * @param id Player's index. |
| 120 | * @param status True to enable or false to disable. |
| 121 | * @noreturn |
| 122 | */ |
| 123 | native cm_set_user_chat_color_status(id, bool:status) |
| 124 | |
| 125 | /** |
| 126 | * Enables/Disables the client's custom name. |
| 127 | * |
| 128 | * @param id Player's index. |
| 129 | * @param status True to enable or false to disable. |
| 130 | * @noreturn |
| 131 | */ |
| 132 | native cm_set_user_custom_name_status(id, bool:status) |
| 133 | |
| 134 | /** |
| 135 | * Sets a temporary prefix on the client. |
| 136 | * |
| 137 | * @note The prefix set with this native won't get saved in the .ini file, so it will be gone after the client's data is updated. |
| 138 | * |
| 139 | * @param id Player's index. |
| 140 | * @param prefix Temporary prefix. |
| 141 | * @noreturn |
| 142 | */ |
| 143 | native cm_set_user_prefix(id, prefix[]) |
| 144 | |
| 145 | /** |
| 146 | * Enables/Disables the client's prefix. |
| 147 | * |
| 148 | * @note It is recommended to leave the "update" parameter to "true" because starting from version 4.1 |
| 149 | * custom data can be set to players who don't have a prefix or their prefix is disabled. |
| 150 | * |
| 151 | * @param id Player's index. |
| 152 | * @param status True to enable or false to disable. |
| 153 | * @param update Whether to automatically update the player's data. |
| 154 | * @noreturn |
| 155 | */ |
| 156 | native cm_set_user_prefix_status(id, bool:status, bool:update = true) |
| 157 | |
| 158 | /** |
| 159 | * Sets a temporary say format on the client. |
| 160 | * |
| 161 | * @note The say format set with this native won't get saved in the .ini file, so it will be gone after the client's data is updated. |
| 162 | * |
| 163 | * @param id Player's index. |
| 164 | * @param say Temporary say format. |
| 165 | * @param say_team Temporary say_team format. |
| 166 | * @return 0 if the format doesn't exist, 1 otherwise. |
| 167 | */ |
| 168 | native cm_set_user_say_format(id, say[], say_team[]) |
| 169 | |
| 170 | /** |
| 171 | * Returns the number ot total chat colors added in the .ini file. |
| 172 | * |
| 173 | * @return Number ot total chat colors added in the .ini file. |
| 174 | */ |
| 175 | native cm_total_chat_colors() |
| 176 | |
| 177 | /** |
| 178 | * Returns the number ot total prefixes added in the .ini file. |
| 179 | * |
| 180 | * @return Number ot total prefixes added in the .ini file. |
| 181 | */ |
| 182 | native cm_total_prefixes() |
| 183 | |
| 184 | /** |
| 185 | * Returns the number ot total say formats registered for players in the .ini file. |
| 186 | * |
| 187 | * @return Number ot total say formats registered for players in the .ini file. |
| 188 | */ |
| 189 | native cm_total_say_formats() |
| 190 | |
| 191 | /** |
| 192 | * Updates the client's prefix and chat color according to the data stored in the plugin. |
| 193 | * |
| 194 | * @note This can be used if you changed the player's admin flags and you want |
| 195 | * to immediately update the player's prefix and chat color. |
| 196 | * |
| 197 | * @param id Player's index. |
| 198 | * @noreturn |
| 199 | */ |
| 200 | native cm_update_player_data(id) |