hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.28. 11:47



Jelenlévő felhasználók

Jelenleg 214 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 214 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 5 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: KÉSZ! Színes teamsay+@ ÉS psay
HozzászólásElküldve: 2014.10.31. 21:29 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.12.15. 19:13
Hozzászólások: 495
Megköszönt másnak: 289 alkalommal
Megköszönték neki: 14 alkalommal
Hali, szeretnék kérni egy plugint(vagy beállítást), ami megváltoztatja az admin chat(teamsay+@) színét. Így az admin, amint írnak neki admin chatben pl. zöld színnel fog mutatkozni. Ebből kifolyólag az admin biztosan felfigyel és látni fogja... Előre is köszönöm!


A hozzászólást 2 alkalommal szerkesztették, utoljára ZiT3K 2021.02.13. 02:20-kor.

Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: SZÍNES admin chat(teamsay+@)
HozzászólásElküldve: 2014.11.17. 19:04 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2014.09.08. 22:21
Hozzászólások: 3014
Megköszönt másnak: 96 alkalommal
Megköszönték neki: 555 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * Admin Chat Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. * originally developed by OLO
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at
  13. * your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software Foundation,
  22. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. * In addition, as a special exception, the author gives permission to
  25. * link the code of this program with the Half-Life Game Engine ("HL
  26. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. * respects for all of the code used other than the HL Engine and MODs
  29. * from Valve. If you modify this file, you may extend this exception
  30. * to your version of the file, but you are not obligated to do so. If
  31. * you do not wish to do so, delete this exception statement from your
  32. * version.
  33. */
  34.  
  35. #include <amxmodx>
  36. #include <amxmisc>
  37. #include <colorchat>
  38.  
  39. new g_msgChannel
  40.  
  41. #define MAX_CLR 10
  42.  
  43. new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
  44. new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
  45. new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}
  46.  
  47. new amx_show_activity;
  48. new g_AdminChatFlag = ADMIN_CHAT;
  49.  
  50. public plugin_init()
  51. {
  52. new admin_chat_id
  53.  
  54. register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
  55. register_dictionary("adminchat.txt")
  56. register_dictionary("common.txt")
  57. register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
  58. register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
  59. register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
  60. admin_chat_id = register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
  61. register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
  62. register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
  63. register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")
  64.  
  65. amx_show_activity = get_cvar_pointer("amx_show_activity");
  66.  
  67. if (amx_show_activity == 0)
  68. {
  69. amx_show_activity = register_cvar("amx_show_activity", "2");
  70. }
  71.  
  72. new str[1]
  73. get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
  74. }
  75.  
  76. public cmdSayChat(id)
  77. {
  78. if (!access(id, g_AdminChatFlag))
  79. {
  80. return PLUGIN_CONTINUE
  81. }
  82.  
  83. new said[6], i = 0
  84. read_argv(1, said, 5)
  85.  
  86. while (said[i] == '@')
  87. {
  88. i++
  89. }
  90.  
  91. if (!i || i > 3)
  92. {
  93. return PLUGIN_CONTINUE
  94. }
  95.  
  96. new message[192], a = 0
  97. read_args(message, 191)
  98. remove_quotes(message)
  99.  
  100. switch (said[i])
  101. {
  102. case 'r': a = 1
  103. case 'g': a = 2
  104. case 'b': a = 3
  105. case 'y': a = 4
  106. case 'm': a = 5
  107. case 'c': a = 6
  108. case 'o': a = 7
  109. }
  110.  
  111. new n, s = i
  112. if (a)
  113. {
  114. n++
  115. s++
  116. }
  117. while (said[s] && isspace(said[s]))
  118. {
  119. n++
  120. s++
  121. }
  122.  
  123.  
  124. new name[32], authid[32], userid
  125.  
  126. get_user_authid(id, authid, 31)
  127. get_user_name(id, name, 31)
  128. userid = get_user_userid(id)
  129.  
  130. log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
  131. log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])
  132.  
  133. if (++g_msgChannel > 6 || g_msgChannel < 3)
  134. {
  135. g_msgChannel = 3
  136. }
  137.  
  138. new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0
  139.  
  140. set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
  141.  
  142. switch ( get_pcvar_num(amx_show_activity) )
  143. {
  144. case 3, 4:
  145. {
  146. new maxpl = get_maxplayers();
  147. for (new pl = 1; pl <= maxpl; pl++)
  148. {
  149. if (is_user_connected(pl) && !is_user_bot(pl))
  150. {
  151. if (is_user_admin(pl))
  152. {
  153. show_hudmessage(pl, "%s : %s", name, message[i + n])
  154. client_print(pl, print_notify, "%s : %s", name, message[i + n])
  155. }
  156. else
  157. {
  158. show_hudmessage(pl, "%s", message[i + n])
  159. client_print(pl, print_notify, "%s", message[i + n])
  160. }
  161. }
  162. }
  163. }
  164. case 2:
  165. {
  166. show_hudmessage(0, "%s : %s", name, message[i + n])
  167. client_print(0, print_notify, "%s : %s", name, message[i + n])
  168. }
  169. default:
  170. {
  171. show_hudmessage(0, "%s", message[i + n])
  172. client_print(0, print_notify, "%s", message[i + n])
  173. }
  174. }
  175.  
  176. return PLUGIN_HANDLED
  177. }
  178.  
  179. public cmdSayAdmin(id)
  180. {
  181. new said[2]
  182. read_argv(1, said, 1)
  183.  
  184. if (said[0] != '@')
  185. return PLUGIN_CONTINUE
  186.  
  187. new message[192], name[32], authid[32], userid
  188. new players[32], inum
  189.  
  190. read_args(message, 191)
  191. remove_quotes(message)
  192. get_user_authid(id, authid, 31)
  193. get_user_name(id, name, 31)
  194. userid = get_user_userid(id)
  195.  
  196. log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
  197. log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])
  198.  
  199. if (is_user_admin(id))
  200. format(message, 191, "(%L) %s : %s", id, "ADMIN", name, message[1])
  201. else
  202. format(message, 191, "(%L) %s : %s", id, "PLAYER", name, message[1])
  203.  
  204. get_players(players, inum)
  205.  
  206. for (new i = 0; i < inum; ++i)
  207. {
  208. // dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
  209. if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
  210. ColorChat(players[i], GREEN, "%s", message)
  211. }
  212.  
  213. ColorChat(id, GREEN, "%s", message)
  214.  
  215. return PLUGIN_HANDLED
  216. }
  217.  
  218. public cmdChat(id, level, cid)
  219. {
  220. if (!cmd_access(id, level, cid, 2))
  221. return PLUGIN_HANDLED
  222.  
  223. new message[192], name[32], players[32], inum, authid[32], userid
  224.  
  225. read_args(message, 191)
  226. remove_quotes(message)
  227. get_user_authid(id, authid, 31)
  228. get_user_name(id, name, 31)
  229. userid = get_user_userid(id)
  230. get_players(players, inum)
  231.  
  232. log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
  233. log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
  234.  
  235. format(message, 191, "(ADMINS) %s : %s", name, message)
  236. console_print(id, "%s", message)
  237.  
  238. for (new i = 0; i < inum; ++i)
  239. {
  240. if (access(players[i], g_AdminChatFlag))
  241. client_print(players[i], print_chat, "%s", message)
  242. }
  243.  
  244. return PLUGIN_HANDLED
  245. }
  246.  
  247. public cmdSay(id, level, cid)
  248. {
  249. if (!cmd_access(id, level, cid, 2))
  250. return PLUGIN_HANDLED
  251.  
  252. new message[192], name[32], authid[32], userid
  253.  
  254. read_args(message, 191)
  255. remove_quotes(message)
  256. get_user_authid(id, authid, 31)
  257. get_user_name(id, name, 31)
  258. userid = get_user_userid(id)
  259. client_print(0, print_chat, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
  260. console_print(id, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
  261.  
  262. log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
  263. log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)
  264.  
  265. return PLUGIN_HANDLED
  266. }
  267.  
  268. public cmdPsay(id, level, cid)
  269. {
  270. if (!cmd_access(id, level, cid, 3))
  271. return PLUGIN_HANDLED
  272.  
  273. new name[32]
  274. read_argv(1, name, 31)
  275. new priv = cmd_target(id, name, 0)
  276.  
  277. if (!priv)
  278. return PLUGIN_HANDLED
  279.  
  280. new length = strlen(name) + 1
  281.  
  282. get_user_name(priv, name, 31);
  283.  
  284. new message[192], name2[32], authid[32], authid2[32], userid, userid2
  285.  
  286. get_user_authid(id, authid, 31)
  287. get_user_name(id, name2, 31)
  288. userid = get_user_userid(id)
  289. read_args(message, 191)
  290.  
  291. if (message[0] == '"' && message[length] == '"') // HLSW fix
  292. {
  293. message[0] = ' '
  294. message[length] = ' '
  295. length += 2
  296. }
  297.  
  298. remove_quotes(message[length])
  299. get_user_name(priv, name, 31)
  300.  
  301. if (id && id != priv)
  302. client_print(id, print_chat, "(%s) %s : %s", name, name2, message[length])
  303.  
  304. client_print(priv, print_chat, "(%s) %s : %s", name, name2, message[length])
  305. console_print(id, "(%s) %s : %s", name, name2, message[length])
  306. get_user_authid(priv, authid2, 31)
  307. userid2 = get_user_userid(priv)
  308.  
  309. log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
  310. log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])
  311.  
  312. return PLUGIN_HANDLED
  313. }
  314.  
  315. public cmdTsay(id, level, cid)
  316. {
  317. if (!cmd_access(id, level, cid, 3))
  318. return PLUGIN_HANDLED
  319.  
  320. new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0
  321.  
  322. read_argv(0, cmd, 15)
  323. new bool:tsay = (tolower(cmd[4]) == 't')
  324.  
  325. read_args(message, 191)
  326. remove_quotes(message)
  327. parse(message, color, 15)
  328.  
  329. new found = 0, a = 0
  330. new lang[3], langnum = get_langsnum()
  331.  
  332. for (new i = 0; i < MAX_CLR; ++i)
  333. {
  334. for (new j = 0; j < langnum; j++)
  335. {
  336. get_lang(j, lang)
  337. format(color2, 15, "%L", lang, g_Colors[i])
  338.  
  339. if (equali(color, color2))
  340. {
  341. a = i
  342. found = 1
  343. break
  344. }
  345. }
  346. if (found == 1)
  347. break
  348. }
  349.  
  350. new length = found ? (strlen(color) + 1) : 0
  351.  
  352. if (++g_msgChannel > 6 || g_msgChannel < 3)
  353. g_msgChannel = 3
  354.  
  355. new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0
  356.  
  357. get_user_authid(id, authid, 31)
  358. get_user_name(id, name, 31)
  359. userid = get_user_userid(id)
  360. set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
  361.  
  362. switch ( get_pcvar_num(amx_show_activity) )
  363. {
  364. case 3, 4:
  365. {
  366. new maxpl = get_maxplayers();
  367. for (new pl = 1; pl <= maxpl; pl++)
  368. {
  369. if (is_user_connected(pl) && !is_user_bot(pl))
  370. {
  371. if (is_user_admin(pl))
  372. {
  373. show_hudmessage(pl, "%s : %s", name, message[length])
  374. client_print(pl, print_notify, "%s : %s", name, message[length])
  375. }
  376. else
  377. {
  378. show_hudmessage(pl, "%s", message[length])
  379. client_print(pl, print_notify, "%s", message[length])
  380. }
  381. }
  382. }
  383. console_print(id, "%s : %s", name, message[length])
  384. }
  385. case 2:
  386. {
  387. show_hudmessage(0, "%s : %s", name, message[length])
  388. client_print(0, print_notify, "%s : %s", name, message[length])
  389. console_print(id, "%s : %s", name, message[length])
  390. }
  391. default:
  392. {
  393. show_hudmessage(0, "%s", message[length])
  394. client_print(0, print_notify, "%s", message[length])
  395. console_print(id, "%s", message[length])
  396. }
  397. }
  398.  
  399. log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
  400. log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)
  401.  
  402. return PLUGIN_HANDLED
  403. }
  404.  

_________________
GitHub - mforce

Ők köszönték meg mforce nek ezt a hozzászólást: ZiT3K (2014.11.17. 19:11)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: SZÍNES admin chat(teamsay+@)
HozzászólásElküldve: 2015.08.07. 09:33 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.12.15. 19:13
Hozzászólások: 495
Megköszönt másnak: 289 alkalommal
Megköszönték neki: 14 alkalommal
Hali!
Még annyit szeretnék kérni, hogy az amx_psay-t csináld meg légyszíves zöldre.
Előre is köszönöm!


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: SZÍNES admin chat(teamsay+@)
HozzászólásElküldve: 2015.08.07. 09:42 
Offline
Tag
Avatar

Csatlakozott: 2015.08.05. 14:00
Hozzászólások: 39
Megköszönt másnak: 2 alkalommal
Megköszönték neki: 9 alkalommal
ZiT3K írta:
Hali!
Még annyit szeretnék kérni, hogy az amx_psay-t csináld meg légyszíves zöldre.
Előre is köszönöm!


Try:

SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * Admin Chat Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. * originally developed by OLO
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at
  13. * your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software Foundation,
  22. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. * In addition, as a special exception, the author gives permission to
  25. * link the code of this program with the Half-Life Game Engine ("HL
  26. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. * respects for all of the code used other than the HL Engine and MODs
  29. * from Valve. If you modify this file, you may extend this exception
  30. * to your version of the file, but you are not obligated to do so. If
  31. * you do not wish to do so, delete this exception statement from your
  32. * version.
  33. */
  34.  
  35. #include <amxmodx>
  36. #include <amxmisc>
  37. #include <colorchat>
  38.  
  39. new g_msgChannel
  40.  
  41. #define MAX_CLR 10
  42.  
  43. new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
  44. new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
  45. new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}
  46.  
  47. new amx_show_activity;
  48. new g_AdminChatFlag = ADMIN_CHAT;
  49.  
  50. public plugin_init()
  51. {
  52. new admin_chat_id
  53.  
  54. register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
  55. register_dictionary("adminchat.txt")
  56. register_dictionary("common.txt")
  57. register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
  58. register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
  59. register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
  60. admin_chat_id = register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
  61. register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
  62. register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
  63. register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")
  64.  
  65. amx_show_activity = get_cvar_pointer("amx_show_activity");
  66.  
  67. if (amx_show_activity == 0)
  68. {
  69. amx_show_activity = register_cvar("amx_show_activity", "2");
  70. }
  71.  
  72. new str[1]
  73. get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
  74. }
  75.  
  76. public cmdSayChat(id)
  77. {
  78. if (!access(id, g_AdminChatFlag))
  79. {
  80. return PLUGIN_CONTINUE
  81. }
  82.  
  83. new said[6], i = 0
  84. read_argv(1, said, 5)
  85.  
  86. while (said[i] == '@')
  87. {
  88. i++
  89. }
  90.  
  91. if (!i || i > 3)
  92. {
  93. return PLUGIN_CONTINUE
  94. }
  95.  
  96. new message[192], a = 0
  97. read_args(message, 191)
  98. remove_quotes(message)
  99.  
  100. switch (said[i])
  101. {
  102. case 'r': a = 1
  103. case 'g': a = 2
  104. case 'b': a = 3
  105. case 'y': a = 4
  106. case 'm': a = 5
  107. case 'c': a = 6
  108. case 'o': a = 7
  109. }
  110.  
  111. new n, s = i
  112. if (a)
  113. {
  114. n++
  115. s++
  116. }
  117. while (said[s] && isspace(said[s]))
  118. {
  119. n++
  120. s++
  121. }
  122.  
  123.  
  124. new name[32], authid[32], userid
  125.  
  126. get_user_authid(id, authid, 31)
  127. get_user_name(id, name, 31)
  128. userid = get_user_userid(id)
  129.  
  130. log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
  131. log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])
  132.  
  133. if (++g_msgChannel > 6 || g_msgChannel < 3)
  134. {
  135. g_msgChannel = 3
  136. }
  137.  
  138. new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0
  139.  
  140. set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
  141.  
  142. switch ( get_pcvar_num(amx_show_activity) )
  143. {
  144. case 3, 4:
  145. {
  146. new maxpl = get_maxplayers();
  147. for (new pl = 1; pl <= maxpl; pl++)
  148. {
  149. if (is_user_connected(pl) && !is_user_bot(pl))
  150. {
  151. if (is_user_admin(pl))
  152. {
  153. show_hudmessage(pl, "%s : %s", name, message[i + n])
  154. client_print(pl, print_notify, "%s : %s", name, message[i + n])
  155. }
  156. else
  157. {
  158. show_hudmessage(pl, "%s", message[i + n])
  159. client_print(pl, print_notify, "%s", message[i + n])
  160. }
  161. }
  162. }
  163. }
  164. case 2:
  165. {
  166. show_hudmessage(0, "%s : %s", name, message[i + n])
  167. client_print(0, print_notify, "%s : %s", name, message[i + n])
  168. }
  169. default:
  170. {
  171. show_hudmessage(0, "%s", message[i + n])
  172. client_print(0, print_notify, "%s", message[i + n])
  173. }
  174. }
  175.  
  176. return PLUGIN_HANDLED
  177. }
  178.  
  179. public cmdSayAdmin(id)
  180. {
  181. new said[2]
  182. read_argv(1, said, 1)
  183.  
  184. if (said[0] != '@')
  185. return PLUGIN_CONTINUE
  186.  
  187. new message[192], name[32], authid[32], userid
  188. new players[32], inum
  189.  
  190. read_args(message, 191)
  191. remove_quotes(message)
  192. get_user_authid(id, authid, 31)
  193. get_user_name(id, name, 31)
  194. userid = get_user_userid(id)
  195.  
  196. log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
  197. log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])
  198.  
  199. if (is_user_admin(id))
  200. format(message, 191, "(%L) %s : %s", id, "ADMIN", name, message[1])
  201. else
  202. format(message, 191, "(%L) %s : %s", id, "PLAYER", name, message[1])
  203.  
  204. get_players(players, inum)
  205.  
  206. for (new i = 0; i < inum; ++i)
  207. {
  208. // dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
  209. if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
  210. ColorChat(players[i], GREEN, "%s", message)
  211. }
  212.  
  213. ColorChat(id, GREEN, "%s", message)
  214.  
  215. return PLUGIN_HANDLED
  216. }
  217.  
  218. public cmdChat(id, level, cid)
  219. {
  220. if (!cmd_access(id, level, cid, 2))
  221. return PLUGIN_HANDLED
  222.  
  223. new message[192], name[32], players[32], inum, authid[32], userid
  224.  
  225. read_args(message, 191)
  226. remove_quotes(message)
  227. get_user_authid(id, authid, 31)
  228. get_user_name(id, name, 31)
  229. userid = get_user_userid(id)
  230. get_players(players, inum)
  231.  
  232. log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
  233. log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
  234.  
  235. format(message, 191, "(ADMINS) %s : %s", name, message)
  236. console_print(id, "%s", message)
  237.  
  238. for (new i = 0; i < inum; ++i)
  239. {
  240. if (access(players[i], g_AdminChatFlag))
  241. client_print(players[i], print_chat, "%s", message)
  242. }
  243.  
  244. return PLUGIN_HANDLED
  245. }
  246.  
  247. public cmdSay(id, level, cid)
  248. {
  249. if (!cmd_access(id, level, cid, 2))
  250. return PLUGIN_HANDLED
  251.  
  252. new message[192], name[32], authid[32], userid
  253.  
  254. read_args(message, 191)
  255. remove_quotes(message)
  256. get_user_authid(id, authid, 31)
  257. get_user_name(id, name, 31)
  258. userid = get_user_userid(id)
  259. client_print(0, print_chat, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
  260. console_print(id, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
  261.  
  262. log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
  263. log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)
  264.  
  265. return PLUGIN_HANDLED
  266. }
  267.  
  268. public cmdPsay(id, level, cid)
  269. {
  270. if (!cmd_access(id, level, cid, 3))
  271. return PLUGIN_HANDLED
  272.  
  273. new name[32]
  274. read_argv(1, name, 31)
  275. new priv = cmd_target(id, name, 0)
  276.  
  277. if (!priv)
  278. return PLUGIN_HANDLED
  279.  
  280. new length = strlen(name) + 1
  281.  
  282. get_user_name(priv, name, 31);
  283.  
  284. new message[192], name2[32], authid[32], authid2[32], userid, userid2
  285.  
  286. get_user_authid(id, authid, 31)
  287. get_user_name(id, name2, 31)
  288. userid = get_user_userid(id)
  289. read_args(message, 191)
  290.  
  291. if (message[0] == '"' && message[length] == '"') // HLSW fix
  292. {
  293. message[0] = ' '
  294. message[length] = ' '
  295. length += 2
  296. }
  297.  
  298. remove_quotes(message[length])
  299. get_user_name(priv, name, 31)
  300.  
  301. if (id && id != priv)
  302. ColorChat(id, GREEN, "(%s) %s : %s", name, name2, message[length])
  303.  
  304. ColorChat(priv, GREEN, "(%s) %s : %s", name, name2, message[length])
  305. console_print(id, "(%s) %s : %s", name, name2, message[length])
  306. get_user_authid(priv, authid2, 31)
  307. userid2 = get_user_userid(priv)
  308.  
  309. log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
  310. log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])
  311.  
  312. return PLUGIN_HANDLED
  313. }
  314.  
  315. public cmdTsay(id, level, cid)
  316. {
  317. if (!cmd_access(id, level, cid, 3))
  318. return PLUGIN_HANDLED
  319.  
  320. new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0
  321.  
  322. read_argv(0, cmd, 15)
  323. new bool:tsay = (tolower(cmd[4]) == 't')
  324.  
  325. read_args(message, 191)
  326. remove_quotes(message)
  327. parse(message, color, 15)
  328.  
  329. new found = 0, a = 0
  330. new lang[3], langnum = get_langsnum()
  331.  
  332. for (new i = 0; i < MAX_CLR; ++i)
  333. {
  334. for (new j = 0; j < langnum; j++)
  335. {
  336. get_lang(j, lang)
  337. format(color2, 15, "%L", lang, g_Colors[i])
  338.  
  339. if (equali(color, color2))
  340. {
  341. a = i
  342. found = 1
  343. break
  344. }
  345. }
  346. if (found == 1)
  347. break
  348. }
  349.  
  350. new length = found ? (strlen(color) + 1) : 0
  351.  
  352. if (++g_msgChannel > 6 || g_msgChannel < 3)
  353. g_msgChannel = 3
  354.  
  355. new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0
  356.  
  357. get_user_authid(id, authid, 31)
  358. get_user_name(id, name, 31)
  359. userid = get_user_userid(id)
  360. set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
  361.  
  362. switch ( get_pcvar_num(amx_show_activity) )
  363. {
  364. case 3, 4:
  365. {
  366. new maxpl = get_maxplayers();
  367. for (new pl = 1; pl <= maxpl; pl++)
  368. {
  369. if (is_user_connected(pl) && !is_user_bot(pl))
  370. {
  371. if (is_user_admin(pl))
  372. {
  373. show_hudmessage(pl, "%s : %s", name, message[length])
  374. client_print(pl, print_notify, "%s : %s", name, message[length])
  375. }
  376. else
  377. {
  378. show_hudmessage(pl, "%s", message[length])
  379. client_print(pl, print_notify, "%s", message[length])
  380. }
  381. }
  382. }
  383. console_print(id, "%s : %s", name, message[length])
  384. }
  385. case 2:
  386. {
  387. show_hudmessage(0, "%s : %s", name, message[length])
  388. client_print(0, print_notify, "%s : %s", name, message[length])
  389. console_print(id, "%s : %s", name, message[length])
  390. }
  391. default:
  392. {
  393. show_hudmessage(0, "%s", message[length])
  394. client_print(0, print_notify, "%s", message[length])
  395. console_print(id, "%s", message[length])
  396. }
  397. }
  398.  
  399. log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
  400. log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)
  401.  
  402. return PLUGIN_HANDLED
  403. }
  404.  

_________________
kiki írta:
Itt senkinek nem kötelessége hogy segítsen neked, így ha megteszi azt köszönd meg, és ha senki sem teszi meg, akkor se okolj senkit érte.

Ők köszönték meg Mr.Freeze nek ezt a hozzászólást: ZiT3K (2015.08.07. 10:21)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: SZÍNES admin chat(teamsay+@)
HozzászólásElküldve: 2015.08.07. 10:21 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.12.15. 19:13
Hozzászólások: 495
Megköszönt másnak: 289 alkalommal
Megköszönték neki: 14 alkalommal
Műkszik!


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 5 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 10 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole