hlmod.hu
https://hlmod.hu/

*DEAD* prefix átírása.
https://hlmod.hu/viewtopic.php?f=29&t=7633
Oldal: 1 / 3

Szerző:  tomy3231 [2013.03.08. 19:37 ]
Hozzászólás témája:  *DEAD* prefix átírása.

Sziasztok.
Van-e egyáltalán olyan plugin, hogy a *DEAD* helyett *HALOTT* ot írjon?
De a admin chat colorsal működjön lehetőleg. Chatbe gondolom, ha halott az ember.
Előre is köszönöm.
Jó helyre nyitottam?

Szerző:  Pele [2013.03.09. 13:32 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2. AllChat v1.1
  3. Copyright (C) 2006-2007 Ian (Juan) Cammarata
  4.  
  5. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  6.  
  7. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  8.  
  9. You should have received a copy of the GNU General Public License along with this program; go to http://www.opensource.org/licenses/gpl-license.php
  10.  
  11.  
  12. Description:
  13. This plugin does for chat what sv_alltalk does for voice. Dead and alive and spectating players can all see each others chat messages. Team chat is still only visible among your team, but with no regard for whether you are dead or alive. By default this plugin works depending on whether or not sv_alltalk is on. It can be forced to be on all the time, as well as setting custom colors for messages that come from admins.
  14.  
  15.  
  16. See it in Action:
  17. Use the following link to find a server that's running this plugin:
  18.  
  19.  
  20. Cvars:
  21. *First value is default
  22.  
  23. sv_allchat <1|2|0>
  24. 1 - Dependent on sv_alltalk
  25. 2 - Always active
  26. 0 - Disabled
  27.  
  28. ac_namecolor <0|1|2>
  29. ac_msgcolor <1|2|0>
  30. 0 - Team color
  31. 1 - Green
  32. 2 - White
  33.  
  34. ac_hidestatus <0|1>
  35. 0 = Show dead/spec status.
  36. 1 = Hide status.
  37.  
  38. ac_teamchat <0|1>
  39. 0 = Dead and living can't team chat.
  40. 1 = Dead and living can team chat.
  41.  
  42.  
  43. Change Log:
  44. Key (+ added | - removed | f fixed | c changed)
  45.  
  46. v1.1 (Aug 14, 2007)
  47. +: Cvar ac_hidestatus to show/hide dead/spec status.
  48. +: Cvar ac_teamchat to enable/disable all chat for team chat.
  49.  
  50. v1.0.1 (June 28, 2007)
  51. f: Replicated messages are now correctly collored based on admin flag.
  52.  
  53. v1.0 (June 26, 2007)
  54. !Complete rewrite.
  55. f: No longer interferes with other plugins.
  56.  
  57. v0.5 (June 21, 2007)
  58. +: Tracking cvar.
  59. c: Uses cvar pointers now.
  60.  
  61. v0.4 (??? ??, 2006) by Ian Cammarata & Dontask
  62. f : Blocking text messages conataining only spaces.
  63.  
  64. v0.3 (June 23, 2006) by Ian Cammarata & Dontask
  65. + : Added multiple values to sv_allchat. See details in Cvar section.
  66. + : Added cvar ac_namecolor to change the color displayed on admins names.
  67. + : Added cvar ac_msgcolor to change the color displayed on admins msgs.
  68. + : Added colored messages even if sv_allchat is set to 1 while alltalk is set to 0.
  69. + : Added equivalent functionality for team say.
  70.  
  71. v0.2.1 (??? ??, 2006) by Ian Cammarata & Dontask
  72. f : Fixed formatting color issues.
  73.  
  74. v0.2 (??? ??, 2006) by Ian Cammarata & Dontask
  75. r : Admins name displayed in team color, message text displayed green.
  76. + : Displays dead status.
  77. + : Added cvar sv_allchat to enable allchat without alltalk enabled.
  78.  
  79. v0.1 (April 04, 2006)
  80. + : Initial release
  81. */
  82.  
  83. #include <amxmodx>
  84.  
  85. #define FLAG ADMIN_RESERVATION
  86. #define VERSION "1.1"
  87.  
  88. new COLCHAR[3][2] = { "^x03"/*team col*/, "^x04"/*green*/, "^x01"/*white*/ }
  89.  
  90. //cvar pointers
  91. new p_allchat, p_namecol, p_msgcol, p_alltalk, p_hidestat, p_teamchat
  92.  
  93. //vars to check if message has already been duplicated
  94. new alv_sndr, alv_str2[26], alv_str4[101]
  95. new msg[200]
  96.  
  97. public col_changer( msg_id, msg_dest, rcvr )
  98. {
  99. new str2[26]
  100. get_msg_arg_string( 2, str2, 25 )
  101. if( equal( str2, "#Cstrike_Chat", 13 ) )
  102. {
  103. new str3[22]
  104. get_msg_arg_string( 3, str3, 21 )
  105.  
  106. if( !strlen( str3 ) )
  107. {
  108. new str4[101]
  109. get_msg_arg_string( 4, str4, 100 )
  110. new sndr = get_msg_arg_int( 1 )
  111.  
  112. new bool:is_team_msg = !bool:equal( str2, "#Cstrike_Chat_All", 17 )
  113.  
  114. new sndr_team = get_user_team( sndr )
  115. new bool:is_sndr_spec = !bool:( 0 < sndr_team < 3 )
  116.  
  117. new namecol = clamp( get_pcvar_num(p_namecol), 0, 2 )
  118. new msgcol = clamp( get_pcvar_num(p_msgcol), 0, 2 )
  119.  
  120. new bool:same_as_last = bool:( alv_sndr == sndr && equal( alv_str2, str2 ) && equal( alv_str4, str4) )
  121.  
  122. if( !same_as_last )
  123. {//Duplicate message once
  124. new allchat = clamp( get_pcvar_num( p_allchat ), 0, 2 )
  125. if( allchat == 2 || ( allchat == 1 && clamp( get_pcvar_num( p_alltalk ), 0, 1 ) == 1 ) )
  126. {
  127. if( !( is_team_msg && ( is_sndr_spec || is_team_msg && get_pcvar_num( p_teamchat ) == 0 ) ) )
  128. {//Don't duplicate if it's a spectator team message
  129. new flags[5], team[10]
  130. if( is_user_alive( sndr ) ) flags = "bch"
  131. else flags = "ach"
  132.  
  133. if( is_team_msg )
  134. {
  135. add( flags[strlen( flags )], 4, "e" )
  136. if( sndr_team == 1 ) team = "TERRORIST"
  137. else team = "CT"
  138. }
  139.  
  140. new players[32], num
  141. get_players( players, num, flags, team )
  142.  
  143. if( get_user_flags( sndr ) & FLAG )
  144. buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4 ) //admin colored, by cvars
  145. else buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, 0, 2, str4 ) //normal colors
  146.  
  147. for( new i=0; i < num; i++ )
  148. {
  149. message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, players[i] )
  150. write_byte( sndr )
  151. write_string( msg )
  152. message_end()
  153. }
  154.  
  155. }
  156.  
  157. alv_sndr = sndr
  158. alv_str2 = str2
  159. alv_str4 = str4
  160. if( task_exists( 411 ) ) remove_task( 411 )
  161. set_task( 0.1, "task_clear_antiloop_vars", 411 )
  162. }
  163. }
  164.  
  165. if( get_user_flags( sndr ) & FLAG && ( namecol != 0 || msgcol != 2 ) )
  166. {//execute if sndr is admin and cols are not set to engine defaults
  167. if( !same_as_last ) buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4 )
  168.  
  169. set_msg_arg_string( 2, msg )
  170. set_msg_arg_string( 4, "" )
  171. }
  172. }
  173. }
  174. return PLUGIN_CONTINUE
  175. }
  176.  
  177. public buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4[ ] )
  178. {
  179. new sndr_name[33]
  180. get_user_name( sndr, sndr_name, 32 )
  181.  
  182. new prefix[30] = "^x01"
  183. if( get_pcvar_num( p_hidestat ) == 0 )
  184. {
  185. if( is_sndr_spec ) prefix = "^x01*SPEC* "
  186. else if( !is_user_alive( sndr ) ) prefix = "^x01*HALOTT* "
  187. }
  188.  
  189. if( is_team_msg )
  190. {
  191. if( is_sndr_spec ) prefix = "^x01(Spectator) "
  192. else if( sndr_team == 1 ) add( prefix[strlen(prefix)-1], 29, "(Terrorist) " )
  193. else if( sndr_team == 2 ) add( prefix[strlen(prefix)-1], 29, "(Counter-Terrorist) " )
  194. }
  195.  
  196. format( msg, 199, "%s%s%s : %s%s",\
  197. strlen( prefix ) > 1 ? prefix : "",\
  198. COLCHAR[namecol], sndr_name, COLCHAR[msgcol], str4 )
  199. return PLUGIN_HANDLED
  200. }
  201.  
  202. public task_clear_antiloop_vars( )
  203. {
  204. alv_sndr = 0
  205. alv_str2 = ""
  206. alv_str4 = ""
  207. return PLUGIN_HANDLED
  208. }
  209.  
  210. public plugin_init( )
  211. {
  212. register_plugin("All Chat",VERSION,"Ian Cammarata")
  213. register_cvar("allchat_version",VERSION,FCVAR_SERVER)
  214.  
  215. p_allchat = register_cvar( "sv_allchat", "1" )
  216. p_namecol = register_cvar( "ac_namecolor", "0" )
  217. p_msgcol = register_cvar( "ac_msgcolor", "1" )
  218. p_hidestat = register_cvar( "ac_hidestatus", "0" )
  219. p_teamchat = register_cvar( "ac_teamchat", "0" )
  220.  
  221. p_alltalk = get_cvar_pointer( "sv_alltalk" )
  222.  
  223. register_message( get_user_msgid("SayText"), "col_changer" )
  224. return PLUGIN_CONTINUE
  225. }

Szerző:  tomy3231 [2013.03.09. 18:46 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

Szia.
Az a baj vele, hogy kiírja a régit is hogy DEAD
És egy csomószor DEAD ot ír.
miért van ez?
Ja és kétszer írja egyszer rendesen egyszer DEAD ot

Szerző:  JoGoBeLLa [2013.03.09. 18:48 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

tomy3231 írta:
Szia.
Az a baj vele, hogy kiírja a régit is hogy DEAD
És egy csomószor DEAD ot ír.
miért van ez?
Ja és kétszer írja egyszer rendesen egyszer DEAD ot

azért írja 2 szer szerintem mert be van rakva vagy az szines admin írás, vagy az admin chat rank

Szerző:  Pele [2013.03.09. 20:07 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

másold ide a plugins.ini -t

Szerző:  tomy3231 [2013.03.10. 09:34 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

Az lehet a baj hogy bent van az admin szín írás?

Szerző:  Pele [2013.03.10. 09:57 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

igen.
Vedd ki.
Maradjon csak az allchat
és ha van valami preixed akkor azt is vedd ki.
vagy linkeld és abba kell be irni a *HALOTT* Prefixet.

Szerző:  tomy3231 [2013.03.10. 10:04 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

Belinkelem. Majd a sma t küldd át.
http://amxmodx.crys.hu/site/?p=pluginz& ... hat_colors
Köszi Pele :)) (név javítva)

Szerző:  Pele [2013.03.10. 15:38 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

Vedd ki az admin chat colors-ot és ezt rkad be!


Pele írta:
SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2. AllChat v1.1
  3. Copyright (C) 2006-2007 Ian (Juan) Cammarata
  4.  
  5. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  6.  
  7. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  8.  
  9. You should have received a copy of the GNU General Public License along with this program; go to http://www.opensource.org/licenses/gpl-license.php
  10.  
  11.  
  12. Description:
  13. This plugin does for chat what sv_alltalk does for voice. Dead and alive and spectating players can all see each others chat messages. Team chat is still only visible among your team, but with no regard for whether you are dead or alive. By default this plugin works depending on whether or not sv_alltalk is on. It can be forced to be on all the time, as well as setting custom colors for messages that come from admins.
  14.  
  15.  
  16. See it in Action:
  17. Use the following link to find a server that's running this plugin:
  18.  
  19.  
  20. Cvars:
  21. *First value is default
  22.  
  23. sv_allchat <1|2|0>
  24. 1 - Dependent on sv_alltalk
  25. 2 - Always active
  26. 0 - Disabled
  27.  
  28. ac_namecolor <0|1|2>
  29. ac_msgcolor <1|2|0>
  30. 0 - Team color
  31. 1 - Green
  32. 2 - White
  33.  
  34. ac_hidestatus <0|1>
  35. 0 = Show dead/spec status.
  36. 1 = Hide status.
  37.  
  38. ac_teamchat <0|1>
  39. 0 = Dead and living can't team chat.
  40. 1 = Dead and living can team chat.
  41.  
  42.  
  43. Change Log:
  44. Key (+ added | - removed | f fixed | c changed)
  45.  
  46. v1.1 (Aug 14, 2007)
  47. +: Cvar ac_hidestatus to show/hide dead/spec status.
  48. +: Cvar ac_teamchat to enable/disable all chat for team chat.
  49.  
  50. v1.0.1 (June 28, 2007)
  51. f: Replicated messages are now correctly collored based on admin flag.
  52.  
  53. v1.0 (June 26, 2007)
  54. !Complete rewrite.
  55. f: No longer interferes with other plugins.
  56.  
  57. v0.5 (June 21, 2007)
  58. +: Tracking cvar.
  59. c: Uses cvar pointers now.
  60.  
  61. v0.4 (??? ??, 2006) by Ian Cammarata & Dontask
  62. f : Blocking text messages conataining only spaces.
  63.  
  64. v0.3 (June 23, 2006) by Ian Cammarata & Dontask
  65. + : Added multiple values to sv_allchat. See details in Cvar section.
  66. + : Added cvar ac_namecolor to change the color displayed on admins names.
  67. + : Added cvar ac_msgcolor to change the color displayed on admins msgs.
  68. + : Added colored messages even if sv_allchat is set to 1 while alltalk is set to 0.
  69. + : Added equivalent functionality for team say.
  70.  
  71. v0.2.1 (??? ??, 2006) by Ian Cammarata & Dontask
  72. f : Fixed formatting color issues.
  73.  
  74. v0.2 (??? ??, 2006) by Ian Cammarata & Dontask
  75. r : Admins name displayed in team color, message text displayed green.
  76. + : Displays dead status.
  77. + : Added cvar sv_allchat to enable allchat without alltalk enabled.
  78.  
  79. v0.1 (April 04, 2006)
  80. + : Initial release
  81. */
  82.  
  83. #include <amxmodx>
  84.  
  85. #define FLAG ADMIN_RESERVATION
  86. #define VERSION "1.1"
  87.  
  88. new COLCHAR[3][2] = { "^x03"/*team col*/, "^x04"/*green*/, "^x01"/*white*/ }
  89.  
  90. //cvar pointers
  91. new p_allchat, p_namecol, p_msgcol, p_alltalk, p_hidestat, p_teamchat
  92.  
  93. //vars to check if message has already been duplicated
  94. new alv_sndr, alv_str2[26], alv_str4[101]
  95. new msg[200]
  96.  
  97. public col_changer( msg_id, msg_dest, rcvr )
  98. {
  99. new str2[26]
  100. get_msg_arg_string( 2, str2, 25 )
  101. if( equal( str2, "#Cstrike_Chat", 13 ) )
  102. {
  103. new str3[22]
  104. get_msg_arg_string( 3, str3, 21 )
  105.  
  106. if( !strlen( str3 ) )
  107. {
  108. new str4[101]
  109. get_msg_arg_string( 4, str4, 100 )
  110. new sndr = get_msg_arg_int( 1 )
  111.  
  112. new bool:is_team_msg = !bool:equal( str2, "#Cstrike_Chat_All", 17 )
  113.  
  114. new sndr_team = get_user_team( sndr )
  115. new bool:is_sndr_spec = !bool:( 0 < sndr_team < 3 )
  116.  
  117. new namecol = clamp( get_pcvar_num(p_namecol), 0, 2 )
  118. new msgcol = clamp( get_pcvar_num(p_msgcol), 0, 2 )
  119.  
  120. new bool:same_as_last = bool:( alv_sndr == sndr && equal( alv_str2, str2 ) && equal( alv_str4, str4) )
  121.  
  122. if( !same_as_last )
  123. {//Duplicate message once
  124. new allchat = clamp( get_pcvar_num( p_allchat ), 0, 2 )
  125. if( allchat == 2 || ( allchat == 1 && clamp( get_pcvar_num( p_alltalk ), 0, 1 ) == 1 ) )
  126. {
  127. if( !( is_team_msg && ( is_sndr_spec || is_team_msg && get_pcvar_num( p_teamchat ) == 0 ) ) )
  128. {//Don't duplicate if it's a spectator team message
  129. new flags[5], team[10]
  130. if( is_user_alive( sndr ) ) flags = "bch"
  131. else flags = "ach"
  132.  
  133. if( is_team_msg )
  134. {
  135. add( flags[strlen( flags )], 4, "e" )
  136. if( sndr_team == 1 ) team = "TERRORIST"
  137. else team = "CT"
  138. }
  139.  
  140. new players[32], num
  141. get_players( players, num, flags, team )
  142.  
  143. if( get_user_flags( sndr ) & FLAG )
  144. buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4 ) //admin colored, by cvars
  145. else buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, 0, 2, str4 ) //normal colors
  146.  
  147. for( new i=0; i < num; i++ )
  148. {
  149. message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, players[i] )
  150. write_byte( sndr )
  151. write_string( msg )
  152. message_end()
  153. }
  154.  
  155. }
  156.  
  157. alv_sndr = sndr
  158. alv_str2 = str2
  159. alv_str4 = str4
  160. if( task_exists( 411 ) ) remove_task( 411 )
  161. set_task( 0.1, "task_clear_antiloop_vars", 411 )
  162. }
  163. }
  164.  
  165. if( get_user_flags( sndr ) & FLAG && ( namecol != 0 || msgcol != 2 ) )
  166. {//execute if sndr is admin and cols are not set to engine defaults
  167. if( !same_as_last ) buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4 )
  168.  
  169. set_msg_arg_string( 2, msg )
  170. set_msg_arg_string( 4, "" )
  171. }
  172. }
  173. }
  174. return PLUGIN_CONTINUE
  175. }
  176.  
  177. public buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4[ ] )
  178. {
  179. new sndr_name[33]
  180. get_user_name( sndr, sndr_name, 32 )
  181.  
  182. new prefix[30] = "^x01"
  183. if( get_pcvar_num( p_hidestat ) == 0 )
  184. {
  185. if( is_sndr_spec ) prefix = "^x01*SPEC* "
  186. else if( !is_user_alive( sndr ) ) prefix = "^x01*HALOTT* "
  187. }
  188.  
  189. if( is_team_msg )
  190. {
  191. if( is_sndr_spec ) prefix = "^x01(Spectator) "
  192. else if( sndr_team == 1 ) add( prefix[strlen(prefix)-1], 29, "(Terrorist) " )
  193. else if( sndr_team == 2 ) add( prefix[strlen(prefix)-1], 29, "(Counter-Terrorist) " )
  194. }
  195.  
  196. format( msg, 199, "%s%s%s : %s%s",\
  197. strlen( prefix ) > 1 ? prefix : "",\
  198. COLCHAR[namecol], sndr_name, COLCHAR[msgcol], str4 )
  199. return PLUGIN_HANDLED
  200. }
  201.  
  202. public task_clear_antiloop_vars( )
  203. {
  204. alv_sndr = 0
  205. alv_str2 = ""
  206. alv_str4 = ""
  207. return PLUGIN_HANDLED
  208. }
  209.  
  210. public plugin_init( )
  211. {
  212. register_plugin("All Chat",VERSION,"Ian Cammarata")
  213. register_cvar("allchat_version",VERSION,FCVAR_SERVER)
  214.  
  215. p_allchat = register_cvar( "sv_allchat", "1" )
  216. p_namecol = register_cvar( "ac_namecolor", "0" )
  217. p_msgcol = register_cvar( "ac_msgcolor", "1" )
  218. p_hidestat = register_cvar( "ac_hidestatus", "0" )
  219. p_teamchat = register_cvar( "ac_teamchat", "0" )
  220.  
  221. p_alltalk = get_cvar_pointer( "sv_alltalk" )
  222.  
  223. register_message( get_user_msgid("SayText"), "col_changer" )
  224. return PLUGIN_CONTINUE
  225. }

Szerző:  tomy3231 [2013.03.10. 15:39 ]
Hozzászólás témája:  Re: *DEAD* prefix átírása.

Meg tudod csinálni, amit most küldtél, hogy az admin pirosan írjon, és zöld legyen a neve?
Előre is köszönöm!

Oldal: 1 / 3 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/