логотип

сообщение о брошенной гранате

Северное
02.02.2016 в 14:37
5
статус DRW 02.02.2016 в 14:37#1
[code]* AMX Mod X* Descriptive 'Fire in the hole!'** (c) Copyright 2006 by VEN** This file is provided as is (no warranties)** DESCRIPTION* Plugin provides additional colored text for "Fire in the hole!" radio chat message.* The color and the text is different for each grenade type and can be altered.* This will help teammates to get the throwed grenade type and act accordingly.* Search for "EDITABLE" mark in the plugin's source code to configure text and color.** CREDITS* Damaged Soul - colored chat text method* p3tsin - team color override method*/#include <amxmodx>#define PLUGIN_NAME "Descriptive 'Fire in the hole!'"#define PLUGIN_VERSION "0.1"#define PLUGIN_AUTHOR "allan"enum grenade { GRENADE_HE, GRENADE_FLASH, GRENADE_SMOKE}// EDITABLE: grenade descriptionnew const g_grenade_description[_:grenade][] = { " Осторожно! [Осколочная] граната", " Осторожно! [Слеповая] граната", " Осторожно! [Дымовая] граната"}enum color { COLOR_NORMAL, COLOR_RED, COLOR_BLUE, COLOR_GRAY, COLOR_GREEN}// EDITABLE: grenade description text colornew const g_grenade_desccolor[_:grenade] = { COLOR_RED, COLOR_GRAY, COLOR_GREEN}new const g_grenade_weaponid[_:grenade] = { CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE}#define COLORCODE_NORMAL 0x01#define COLORCODE_TEAM 0x03#define COLORCODE_LOCATION 0x04new const g_color_code[_:color] = { COLORCODE_NORMAL, COLORCODE_TEAM, COLORCODE_TEAM, COLORCODE_TEAM, COLORCODE_LOCATION}new const g_color_teamname[_:color][] = { "", "TERRORIST", "CT", "SPECTATOR", ""}#define RADIOTEXT_MSGARG_NUMBER 5enum radiotext_msgarg { RADIOTEXT_MSGARG_PRINTDEST = 1, RADIOTEXT_MSGARG_CALLERID, RADIOTEXT_MSGARG_TEXTTYPE, RADIOTEXT_MSGARG_CALLERNAME, RADIOTEXT_MSGARG_RADIOTYPE,}new const g_required_radiotype[] = "#Fire_in_the_hole"new const g_radiotext_template[] = "%s (РАДИО):"new g_msgid_saytextnew g_msgid_teaminfopublic plugin_init() { register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR) register_message(get_user_msgid("TextMsg"), "message_text") g_msgid_saytext = get_user_msgid("SayText") g_msgid_teaminfo = get_user_msgid("TeamInfo")}public message_text(msgid, dest, id) { if (get_msg_args() != RADIOTEXT_MSGARG_NUMBER || get_msg_argtype(RADIOTEXT_MSGARG_RADIOTYPE) != ARG_STRING) return PLUGIN_CONTINUE static arg[32] get_msg_arg_string(RADIOTEXT_MSGARG_RADIOTYPE, arg, sizeof arg - 1) if (!equal(arg, g_required_radiotype)) return PLUGIN_CONTINUE get_msg_arg_string(RADIOTEXT_MSGARG_CALLERID, arg, sizeof arg - 1) new caller = str_to_num(arg) if (!is_user_alive(caller)) return PLUGIN_CONTINUE new clip, ammo, weapon weapon = get_user_weapon(caller, clip, ammo) for (new i; i < sizeof g_grenade_weaponid; ++i) { if (g_grenade_weaponid[i] == weapon) { static text[192] new pos = 0 text[pos++] = g_color_code[COLOR_NORMAL] get_msg_arg_string(RADIOTEXT_MSGARG_CALLERNAME, arg, sizeof arg - 1) pos += formatex(text[pos], sizeof text - pos - 1, g_radiotext_template, arg) copy(text[++pos], sizeof text - pos - 1, g_grenade_description[i]) new desccolor = g_grenade_desccolor[i] if ((text[--pos] = g_color_code[desccolor]) == COLORCODE_TEAM) { static teamname[12] get_user_team(id, teamname, sizeof teamname - 1) if (!equal(teamname, g_color_teamname[desccolor])) { msg_teaminfo(id, g_color_teamname[desccolor]) msg_saytext(id, text) msg_teaminfo(id, teamname) return PLUGIN_HANDLED } } msg_saytext(id, text) return PLUGIN_HANDLED } } return PLUGIN_CONTINUE}msg_teaminfo(id, teamname[]) { message_begin(MSG_ONE, g_msgid_teaminfo, _, id) write_byte(id) write_string(teamname) message_end()}msg_saytext(id, text[]) { message_begin(MSG_ONE, g_msgid_saytext, _, id) write_byte(id) write_string(text) message_end()[/code]
аватарка
Сообщений: 657
Реакции: 50
Клиенты
  1. * AMX Mod X
  2. * Descriptive 'Fire in the hole!'
  3. *
  4. * (c) Copyright 2006 by VEN
  5. *
  6. * This file is provided as is (no warranties)
  7. *
  8. * DESCRIPTION
  9. * Plugin provides additional colored text for "Fire in the hole!" radio chat message.
  10. * The color and the text is different for each grenade type and can be altered.
  11. * This will help teammates to get the throwed grenade type and act accordingly.
  12. * Search for "EDITABLE" mark in the plugin's source code to configure text and color.
  13. *
  14. * CREDITS
  15. * Damaged Soul - colored chat text method
  16. * p3tsin - team color override method
  17. */
  18.  
  19. #include <amxmodx>
  20.  
  21. #define PLUGIN_NAME "Descriptive 'Fire in the hole!'"
  22. #define PLUGIN_VERSION "0.1"
  23. #define PLUGIN_AUTHOR "allan"
  24.  
  25. enum grenade {
  26. GRENADE_HE,
  27. GRENADE_FLASH,
  28. GRENADE_SMOKE
  29. }
  30.  
  31. // EDITABLE: grenade description
  32. new const g_grenade_description[_:grenade][] = {
  33. " Осторожно! [Осколочная] граната",
  34. " Осторожно! [Слеповая] граната",
  35. " Осторожно! [Дымовая] граната"
  36. }
  37.  
  38. enum color {
  39. COLOR_NORMAL,
  40. COLOR_RED,
  41. COLOR_BLUE,
  42. COLOR_GRAY,
  43. COLOR_GREEN
  44. }
  45.  
  46. // EDITABLE: grenade description text color
  47. new const g_grenade_desccolor[_:grenade] = {
  48. COLOR_RED,
  49. COLOR_GRAY,
  50. COLOR_GREEN
  51. }
  52.  
  53. new const g_grenade_weaponid[_:grenade] = {
  54. CSW_HEGRENADE,
  55. CSW_FLASHBANG,
  56. CSW_SMOKEGRENADE
  57. }
  58.  
  59. #define COLORCODE_NORMAL 0x01
  60. #define COLORCODE_TEAM 0x03
  61. #define COLORCODE_LOCATION 0x04
  62.  
  63. new const g_color_code[_:color] = {
  64. COLORCODE_NORMAL,
  65. COLORCODE_TEAM,
  66. COLORCODE_TEAM,
  67. COLORCODE_TEAM,
  68. COLORCODE_LOCATION
  69. }
  70.  
  71. new const g_color_teamname[_:color][] = {
  72. "",
  73. "TERRORIST",
  74. "CT",
  75. "SPECTATOR",
  76. ""
  77. }
  78.  
  79. #define RADIOTEXT_MSGARG_NUMBER 5
  80.  
  81. enum radiotext_msgarg {
  82. RADIOTEXT_MSGARG_PRINTDEST = 1,
  83. RADIOTEXT_MSGARG_CALLERID,
  84. RADIOTEXT_MSGARG_TEXTTYPE,
  85. RADIOTEXT_MSGARG_CALLERNAME,
  86. RADIOTEXT_MSGARG_RADIOTYPE,
  87. }
  88.  
  89. new const g_required_radiotype[] = "#Fire_in_the_hole"
  90. new const g_radiotext_template[] = "%s (РАДИО):"
  91.  
  92. new g_msgid_saytext
  93. new g_msgid_teaminfo
  94.  
  95. public plugin_init() {
  96. register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
  97.  
  98. register_message(get_user_msgid("TextMsg"), "message_text")
  99.  
  100. g_msgid_saytext = get_user_msgid("SayText")
  101. g_msgid_teaminfo = get_user_msgid("TeamInfo")
  102. }
  103.  
  104. public message_text(msgid, dest, id) {
  105. if (get_msg_args() != RADIOTEXT_MSGARG_NUMBER || get_msg_argtype(RADIOTEXT_MSGARG_RADIOTYPE) != ARG_STRING)
  106. return PLUGIN_CONTINUE
  107.  
  108. static arg[32]
  109. get_msg_arg_string(RADIOTEXT_MSGARG_RADIOTYPE, arg, sizeof arg - 1)
  110. if (!equal(arg, g_required_radiotype))
  111. return PLUGIN_CONTINUE
  112.  
  113. get_msg_arg_string(RADIOTEXT_MSGARG_CALLERID, arg, sizeof arg - 1)
  114. new caller = str_to_num(arg)
  115. if (!is_user_alive(caller))
  116. return PLUGIN_CONTINUE
  117.  
  118. new clip, ammo, weapon
  119. weapon = get_user_weapon(caller, clip, ammo)
  120. for (new i; i < sizeof g_grenade_weaponid; ++i) {
  121. if (g_grenade_weaponid[i] == weapon) {
  122. static text[192]
  123. new pos = 0
  124. text[pos++] = g_color_code[COLOR_NORMAL]
  125.  
  126. get_msg_arg_string(RADIOTEXT_MSGARG_CALLERNAME, arg, sizeof arg - 1)
  127. pos += formatex(text[pos], sizeof text - pos - 1, g_radiotext_template, arg)
  128. copy(text[++pos], sizeof text - pos - 1, g_grenade_description[i])
  129.  
  130. new desccolor = g_grenade_desccolor[i]
  131. if ((text[--pos] = g_color_code[desccolor]) == COLORCODE_TEAM) {
  132. static teamname[12]
  133. get_user_team(id, teamname, sizeof teamname - 1)
  134.  
  135. if (!equal(teamname, g_color_teamname[desccolor])) {
  136. msg_teaminfo(id, g_color_teamname[desccolor])
  137. msg_saytext(id, text)
  138. msg_teaminfo(id, teamname)
  139.  
  140. return PLUGIN_HANDLED
  141. }
  142. }
  143.  
  144. msg_saytext(id, text)
  145.  
  146. return PLUGIN_HANDLED
  147. }
  148. }
  149.  
  150. return PLUGIN_CONTINUE
  151. }
  152.  
  153. msg_teaminfo(id, teamname[]) {
  154. message_begin(MSG_ONE, g_msgid_teaminfo, _, id)
  155. write_byte(id)
  156. write_string(teamname)
  157. message_end()
  158. }
  159.  
  160. msg_saytext(id, text[]) {
  161. message_begin(MSG_ONE, g_msgid_saytext, _, id)
  162. write_byte(id)
  163. write_string(text)
  164. message_end()
Ответить Цитата
статус LiSkeiJ 02.02.2016 в 14:47#2
Код на 200 строк который блокирует только сообщения мда...., есть намного оптимизированный код от неугомона или же от того же Safety1st'a.
аватарка
Сообщений: 634
Реакции: 58
Клиенты
Код на 200 строк который блокирует только сообщения мда...., есть намного оптимизированный код от неугомона или же от того же Safety1st'a.
Ответить Цитата
статус DRW 02.02.2016 в 15:17#3
[b]LiSkeiJ[/b],он не блокирует сообщение он его виводит сообщение о брошенной гранате
аватарка
Сообщений: 657
Реакции: 50
Клиенты
LiSkeiJ,он не блокирует сообщение он его виводит сообщение о брошенной гранате
Ответить Цитата
статус LiSkeiJ 02.02.2016 в 18:19#4
[b]DRW[/b], Жаль тут нету смайла facepalmНеужели такие плагины еще ставят? Засоряя таким образом чат и канал клиенту
аватарка
Сообщений: 634
Реакции: 58
Клиенты
DRW, Жаль тут нету смайла facepalm
Неужели такие плагины еще ставят? Засоряя таким образом чат и канал клиенту
Ответить Цитата
статус DRW 06.02.2016 в 22:27#5
не нравится не став,я тебя не зачтавляю
аватарка
Сообщений: 657
Реакции: 50
Клиенты
не нравится не став,я тебя не зачтавляю
Ответить Цитата
Информация
Войдите или зарегистрируйтесь для общения на форуме
Перетащите файлы или нажмите
Максимально 5 файлов. Максимальный размер 20 Мб.

Игровые сервера Дополнительные услуги Инфо Сообщество

android

application chrometelegramapiCSHOST.COM.UA 2012-2025 Хостинг игровых серверов