hlmod.hu
https://hlmod.hu/

Allchat
https://hlmod.hu/viewtopic.php?f=10&t=10612
Oldal: 1 / 1

Szerző:  norbee.16 [2013.08.31. 23:55 ]
Hozzászólás témája:  Allchat

Hali! Valaki ki javítana nekem.
Hiba:
SMA Forráskód: [ Mindet kijelol ]
  1. Welcome to the AMX Mod X 1.8.1-300 Compiler.
  2. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
  3.  
  4. /src/php4I5NhM.sma(393) : error 075: input line too long (after substitutions)
  5. /src/php4I5NhM.sma(394 -- 395) : error 075: input line too long (after substitutions)
  6.  
  7. 2 Errors.
  8. Could not locate output file /bin/php4I5NhM.amx (compile failed).

SMA:
SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2.  
  3. AllChat v1.1
  4.  
  5. Copyright (C) 2006-2007 Ian (Juan) Cammarata
  6.  
  7.  
  8.  
  9. 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.
  10.  
  11.  
  12.  
  13. 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.
  14.  
  15.  
  16.  
  17. 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
  18.  
  19.  
  20.  
  21.  
  22.  
  23. Description:
  24.  
  25. 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.
  26.  
  27.  
  28.  
  29.  
  30.  
  31. See it in Action:
  32.  
  33. Use the following link to find a server that's running this plugin:
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. Cvars:
  41.  
  42. *First value is default
  43.  
  44.  
  45.  
  46. sv_allchat <1|2|0>
  47.  
  48. 1 - Dependent on sv_alltalk
  49.  
  50. 2 - Always active
  51.  
  52. 0 - Disabled
  53.  
  54.  
  55.  
  56. ac_namecolor <0|1|2>
  57.  
  58. ac_msgcolor <1|2|0>
  59.  
  60. 0 - Team color
  61.  
  62. 1 - Green
  63.  
  64. 2 - White
  65.  
  66.  
  67.  
  68. ac_hidestatus <0|1>
  69.  
  70. 0 = Show dead/spec status.
  71.  
  72. 1 = Hide status.
  73.  
  74.  
  75.  
  76. ac_teamchat <0|1>
  77.  
  78. 0 = Dead and living can't team chat.
  79.  
  80. 1 = Dead and living can team chat.
  81.  
  82.  
  83.  
  84.  
  85.  
  86. Change Log:
  87.  
  88. Key (+ added | - removed | f fixed | c changed)
  89.  
  90.  
  91.  
  92. v1.1 (Aug 14, 2007)
  93.  
  94. +: Cvar ac_hidestatus to show/hide dead/spec status.
  95.  
  96. +: Cvar ac_teamchat to enable/disable all chat for team chat.
  97.  
  98.  
  99.  
  100. v1.0.1 (June 28, 2007)
  101.  
  102. f: Replicated messages are now correctly collored based on admin flag.
  103.  
  104.  
  105.  
  106. v1.0 (June 26, 2007)
  107.  
  108. !Complete rewrite.
  109.  
  110. f: No longer interferes with other plugins.
  111.  
  112.  
  113.  
  114. v0.5 (June 21, 2007)
  115.  
  116. +: Tracking cvar.
  117.  
  118. c: Uses cvar pointers now.
  119.  
  120.  
  121.  
  122. v0.4 (??? ??, 2006) by Ian Cammarata & Dontask
  123.  
  124. f : Blocking text messages conataining only spaces.
  125.  
  126.  
  127.  
  128. v0.3 (June 23, 2006) by Ian Cammarata & Dontask
  129.  
  130. + : Added multiple values to sv_allchat. See details in Cvar section.
  131.  
  132. + : Added cvar ac_namecolor to change the color displayed on admins names.
  133.  
  134. + : Added cvar ac_msgcolor to change the color displayed on admins msgs.
  135.  
  136. + : Added colored messages even if sv_allchat is set to 1 while alltalk is set to 0.
  137.  
  138. + : Added equivalent functionality for team say.
  139.  
  140.  
  141.  
  142. v0.2.1 (??? ??, 2006) by Ian Cammarata & Dontask
  143.  
  144. f : Fixed formatting color issues.
  145.  
  146.  
  147.  
  148. v0.2 (??? ??, 2006) by Ian Cammarata & Dontask
  149.  
  150. r : Admins name displayed in team color, message text displayed green.
  151.  
  152. + : Displays dead status.
  153.  
  154. + : Added cvar sv_allchat to enable allchat without alltalk enabled.
  155.  
  156.  
  157.  
  158. v0.1 (April 04, 2006)
  159.  
  160. + : Initial release
  161.  
  162. */
  163.  
  164.  
  165.  
  166. #include <amxmodx>
  167.  
  168.  
  169.  
  170. #define FLAG ADMIN_RESERVATION
  171.  
  172. #define VERSION "1.1"
  173.  
  174.  
  175.  
  176. new COLCHAR[3][2] = { "^x03"/*team col*/, "^x04"/*green*/, "^x01"/*white*/ }
  177.  
  178.  
  179.  
  180. //cvar pointers
  181.  
  182. new p_allchat, p_namecol, p_msgcol, p_alltalk, p_hidestat, p_teamchat
  183.  
  184.  
  185.  
  186. //vars to check if message has already been duplicated
  187.  
  188. new alv_sndr, alv_str2[26], alv_str4[101]
  189.  
  190. new msg[200]
  191.  
  192.  
  193.  
  194. public col_changer( msg_id, msg_dest, rcvr )
  195.  
  196. {
  197.  
  198. new str2[26]
  199.  
  200. get_msg_arg_string( 2, str2, 25 )
  201.  
  202. if( equal( str2, "#Cstrike_Chat", 13 ) )
  203.  
  204. {
  205.  
  206. new str3[22]
  207.  
  208. get_msg_arg_string( 3, str3, 21 )
  209.  
  210.  
  211.  
  212. if( !strlen( str3 ) )
  213.  
  214. {
  215.  
  216. new str4[101]
  217.  
  218. get_msg_arg_string( 4, str4, 100 )
  219.  
  220. new sndr = get_msg_arg_int( 1 )
  221.  
  222.  
  223.  
  224. new bool:is_team_msg = !bool:equal( str2, "#Cstrike_Chat_All", 17 )
  225.  
  226.  
  227.  
  228. new sndr_team = get_user_team( sndr )
  229.  
  230. new bool:is_sndr_spec = !bool:( 0 < sndr_team < 3 )
  231.  
  232.  
  233.  
  234. new namecol = clamp( get_pcvar_num(p_namecol), 0, 2 )
  235.  
  236. new msgcol = clamp( get_pcvar_num(p_msgcol), 0, 2 )
  237.  
  238.  
  239.  
  240. new bool:same_as_last = bool:( alv_sndr == sndr && equal( alv_str2, str2 ) && equal( alv_str4, str4) )
  241.  
  242.  
  243.  
  244. if( !same_as_last )
  245.  
  246. {//Duplicate message once
  247.  
  248. new allchat = clamp( get_pcvar_num( p_allchat ), 0, 2 )
  249.  
  250. if( allchat == 2 || ( allchat == 1 && clamp( get_pcvar_num( p_alltalk ), 0, 1 ) == 1 ) )
  251.  
  252. {
  253.  
  254. if( !( is_team_msg && ( is_sndr_spec || is_team_msg && get_pcvar_num( p_teamchat ) == 0 ) ) )
  255.  
  256. {//Don't duplicate if it's a spectator team message
  257.  
  258. new flags[5], team[10]
  259.  
  260. if( is_user_alive( sndr ) ) flags = "bch"
  261.  
  262. else flags = "ach"
  263.  
  264.  
  265.  
  266. if( is_team_msg )
  267.  
  268. {
  269.  
  270. add( flags[strlen( flags )], 4, "e" )
  271.  
  272. if( sndr_team == 1 ) team = "TERRORIST"
  273.  
  274. else team = "CT"
  275.  
  276. }
  277.  
  278.  
  279.  
  280. new players[32], num
  281.  
  282. get_players( players, num, flags, team )
  283.  
  284.  
  285.  
  286. if( get_user_flags( sndr ) & FLAG )
  287.  
  288. buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4 ) //admin colored, by cvars
  289.  
  290. else buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, 0, 2, str4 ) //normal colors
  291.  
  292.  
  293.  
  294. for( new i=0; i < num; i++ )
  295.  
  296. {
  297.  
  298. message_begin( MSG_ONE, get_user_msgid( "SayText" ), _, players[i] )
  299.  
  300. write_byte( sndr )
  301.  
  302. write_string( msg )
  303.  
  304. message_end()
  305.  
  306. }
  307.  
  308.  
  309.  
  310. }
  311.  
  312.  
  313.  
  314. alv_sndr = sndr
  315.  
  316. alv_str2 = str2
  317.  
  318. alv_str4 = str4
  319.  
  320. if( task_exists( 411 ) ) remove_task( 411 )
  321.  
  322. set_task( 0.1, "task_clear_antiloop_vars", 411 )
  323.  
  324. }
  325.  
  326. }
  327.  
  328.  
  329.  
  330. if( get_user_flags( sndr ) & FLAG && ( namecol != 0 || msgcol != 2 ) )
  331.  
  332. {//execute if sndr is admin and cols are not set to engine defaults
  333.  
  334. if( !same_as_last ) buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4 )
  335.  
  336.  
  337.  
  338. set_msg_arg_string( 2, msg )
  339.  
  340. set_msg_arg_string( 4, "" )
  341.  
  342. }
  343.  
  344. }
  345.  
  346. }
  347.  
  348. return PLUGIN_CONTINUE
  349.  
  350. }
  351.  
  352.  
  353.  
  354. public buildmsg( sndr, is_sndr_spec, is_team_msg, sndr_team, namecol, msgcol, str4[ ] )
  355.  
  356. {
  357.  
  358. new sndr_name[33]
  359.  
  360. get_user_name( sndr, sndr_name, 32 )
  361.  
  362.  
  363.  
  364. new prefix[30] = "^x01"
  365.  
  366. if( get_pcvar_num( p_hidestat ) == 0 )
  367.  
  368. {
  369.  
  370. if( is_sndr_spec ) prefix = "^x01*SPEC* "
  371.  
  372. else if( !is_user_alive( sndr ) ) prefix = "^x01*DEAD* "
  373.  
  374. }
  375.  
  376.  
  377.  
  378. if( is_team_msg )
  379.  
  380. {
  381.  
  382. if( is_sndr_spec ) prefix = "^x01(Spectator) "
  383.  
  384. else if( sndr_team == 1 ) add( prefix[strlen(prefix)-1], 29, "(Terrorist) " )
  385.  
  386. else if( sndr_team == 2 ) add( prefix[strlen(prefix)-1], 29, "(Counter-Terrorist) " )
  387.  
  388. }
  389.  
  390.  
  391.  
  392. format( msg, 199, "%s%s%s : %s%s",\
  393.  
  394. strlen( prefix ) > 1 ? prefix : "",\
  395.  
  396. COLCHAR[namecol], sndr_name, COLCHAR[msgcol], str4 )
  397.  
  398. return PLUGIN_HANDLED
  399.  
  400. }
  401.  
  402.  
  403.  
  404. public task_clear_antiloop_vars( )
  405.  
  406. {
  407.  
  408. alv_sndr = 0
  409.  
  410. alv_str2 = ""
  411.  
  412. alv_str4 = ""
  413.  
  414. return PLUGIN_HANDLED
  415.  
  416. }
  417.  
  418.  
  419.  
  420. public plugin_init( )
  421.  
  422. {
  423.  
  424. register_plugin("All Chat",VERSION,"Ian Cammarata")
  425.  
  426. register_cvar("allchat_version",VERSION,FCVAR_SERVER)
  427.  
  428.  
  429.  
  430. p_allchat = register_cvar( "sv_allchat", "1" )
  431.  
  432. p_namecol = register_cvar( "ac_namecolor", "1" )
  433.  
  434. p_msgcol = register_cvar( "ac_msgcolor", "0" )
  435.  
  436. p_hidestat = register_cvar( "ac_hidestatus", "0" )
  437.  
  438. p_teamchat = register_cvar( "ac_teamchat", "0" )
  439.  
  440.  
  441.  
  442. p_alltalk = get_cvar_pointer( "sv_alltalk" )
  443.  
  444.  
  445.  
  446. register_message( get_user_msgid("SayText"), "col_changer" )
  447.  
  448. return PLUGIN_CONTINUE
  449.  
  450. }

Szerző:  kiki [2013.09.01. 11:15 ]
Hozzászólás témája:  Re: Allchat

393. sorba mit akarsz formázni?

Szerző:  norbee.16 [2013.09.01. 11:22 ]
Hozzászólás témája:  Re: Allchat

kiki írta:
393. sorba mit akarsz formázni?

én semmit xd csak 2 cvart írtam át. Az oldalról le szedtem és 2 db cvart írtam át és enyi :)

Szerző:  kiki [2013.09.01. 11:32 ]
Hozzászólás témája:  Re: Allchat

Akkor szedd le ujra, és compileled le!

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