hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.17. 01:37



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot]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  [2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Radio
HozzászólásElküldve:2015.10.28. 22:11 
Offline
Jómunkásember
Avatar

Csatlakozott:2015.01.24. 18:17
Hozzászólások:310
Megköszönt másnak: 22 alkalommal
Megköszönték neki: 11 alkalommal
Heló, hogyan birok rádiót csinálni, mármint megvan a parancs amire rádiózni fog de mi a rádió kódja?
Értelmetlen.. :(

Idézet:
RADIO : Reloading!

Ezt a szöveget szeretném hozzákötni egy parancshoz, csak nem tudom, hogyan kell ezt a szöveget megcsinálni.

Válaszokat előre is köszönöm. :)

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Radio
HozzászólásElküldve:2015.11.05. 18:03 
Offline
Felfüggesztve
Avatar

Csatlakozott:2013.06.09. 18:47
Hozzászólások:2004
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 220 alkalommal
Talán ez segít:

SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * Advanced Radio plugin based on Advanced Radio Commands by KaLoSZyFeR
  3. *
  4. * (c) Copyright 2007 by KaLoSZyFeR
  5. * (c) Copyright 2009 by Joăo Ricardo Lourenço (AKA Jorl17; jorl17.8@gmail.com)
  6. *
  7. * KaLoSZyFer published this code in the public domain.
  8. * I (Jorl17) hereby license my modification under the
  9. * GNU GPL - Protecting everyone's freedoms.
  10. *
  11. * =====================================================================
  12. *
  13. * This program is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation, either version 3 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.*
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. *
  26. * =====================================================================
  27. *
  28. * ORIGINAL (KaLoSZyFeR's) DESCRIPTION
  29. * Plugin changes old and adds new customizable menu, allow hear custom radio
  30. * commands, also included something like VEN's Real Radio.
  31. *
  32. * ORIGINAL (KaLoSZyFeR's) FEATURES
  33. * - custom radio commands (sounds and messages)
  34. * - custom menus
  35. * - real radio effect
  36. *
  37. * =====================================================================
  38. *
  39. * DESCRIPTION
  40. * This plugin enables the server admin to reconfigure the radio messages.
  41. * It also adds a fourth menu which can by binded to a key (such as 'v').
  42. * Unlike KaLoSZyFeR's plugin, no custom commands are supported,
  43. * although the 'Fire in the hole!' can still be altered.
  44. * Additionally, it puts all the customization in the hands of the server
  45. * admininistrator.
  46. *
  47. * CVARS
  48. * amx_custom_radio (0: OFF, 1: ON, default: 1) - disables/enables plugin
  49. * amx_real_radio (0: OFF, 1: ON, default: 1) - disables/enables real radio effect
  50. * amx_radio_info (0: OFF, 1: ON, default: 1) - disables/enables viewing info about
  51. * plugin on start of server
  52. *
  53. * CUSTOMIZATION
  54. * Since there are 4 radio groups, I shall name them 'A','B', 'C' and 'D'.
  55. * There is a limit of 9 options for each group (there are only 9 positive integers
  56. * before 10).
  57. *
  58. * Given the two previous statements, one can set the messages to use by following
  59. * the rule (note that RC comes from Radio Command):
  60. * RC<group><option> "message"
  61. * For instance, if one wanted to define that the first group's message is 'Cover me!',
  62. * this could be achieved by writting the following in custom_radio.amxx:
  63. *
  64. * RCA1 "Cover me!"
  65. *
  66. * Similarly, one can set the third's group fourth message to be "Roger that!":
  67. *
  68. * RCC4 "Roger that!"
  69. *
  70. * To specify a sound, the same logic is applied, but the syntax becomes:
  71. *
  72. * RC<group><option>Sound "file location in sound folder"
  73. *
  74. * Here's an example:
  75. *
  76. * RCD2 "Cover that!"
  77. * RCD2Music "radio/custom/coverthat1.wav".
  78. *
  79. * Simply DO NOT FORGET to specify THE NUMBER OF COMMANDS which you have. This
  80. * can be achieved with the following Variables:
  81. * amx_radio_cmdsA
  82. * amx_radio_cmdsB
  83. * amx_radio_cmdsC
  84. * amx_radio_cmdsD
  85. *
  86. * Each one of them sets the number of comands for each group.
  87. *
  88. * Most options found in the previous plugin (such as colors) can still be used
  89. * with this plugin.
  90. *
  91. *
  92. * =====================================================================
  93. *
  94. *
  95. * MODIFICATIONS
  96. *
  97. * While editing this code, I (Jorl17) cleaned everything up
  98. * and turned it into a more easy-to-ready code. I also matched it
  99. * to my coding standards, simplifying and sometimes optimizing it.
  100. *
  101. */
  102.  
  103. #include <amxmodx>
  104. #include <amxmisc>
  105. #include <engine>
  106. #include <csx>
  107. #include <fakemeta>
  108.  
  109.  
  110. #define PLUGIN "Advanced Radio"
  111. #define VERSION "1.0"
  112. #define AUTHOR "Jorl17 & KaLoSZyFeR"
  113.  
  114. /* CONFIG SETUP */
  115.  
  116. #define MAX_OPTIONS 10 //The maximum number of options in a radio command
  117.  
  118. new Radio1Cmds;
  119. new Radio2Cmds;
  120. new Radio3Cmds;
  121. new Radio4Cmds;
  122. new Radio1Commands[MAX_OPTIONS][64];
  123. new Radio2Commands[MAX_OPTIONS][64];
  124. new Radio3Commands[MAX_OPTIONS][64];
  125. new Radio4Commands[MAX_OPTIONS][64];
  126. new g_RadioTimer[33];
  127. new CRexit[64];
  128. new CRcolortitle[2];
  129. new CRcolormenu[2];
  130.  
  131. new CRfireinhole[64];
  132.  
  133. new Radio1Wavs[MAX_OPTIONS][64];
  134. new Radio2Wavs[MAX_OPTIONS][64];
  135. new Radio3Wavs[MAX_OPTIONS][64];
  136. new Radio4Wavs[MAX_OPTIONS][64];
  137.  
  138. //General function to be used by all of them. Some kind of OOP <!-- s:D --><img src=\"{SMILIES_PATH}/icon_e_biggrin.gif\" alt=\":D\" title=\"nagyon boldog\" /><!-- s:D -->
  139. public radio ( id, menustr[], counter, commandsArray[][] ) {
  140.  
  141. if ( !get_cvar_num ( "amx_custom_radio" ) ) //Check that we're ready to go.
  142. return PLUGIN_CONTINUE;
  143.  
  144. if ( is_user_alive ( id ) == 0 ) return PLUGIN_HANDLED;
  145.  
  146. new key = ( 1 << 0 );
  147.  
  148. new menu_body[512];
  149.  
  150. //The Title
  151. new len = format ( menu_body, 511, "\%s%s\%s^n\ ", CRcolortitle, menustr, CRcolormenu );
  152.  
  153. //Loop through the array and print the options
  154. for ( new i ; i < counter ; i++ ) {
  155. key |= ( 1 << i );
  156. len += format ( menu_body[len], 511 - len, "%d. %s^n\ ", i + 1, commandsArray[i] );
  157. }
  158.  
  159. len += format ( menu_body[len], 511 - len, "^n\ " ); //newline
  160.  
  161. len += format ( menu_body[len], 511 - len, "0. %s", CRexit ); //Exit.
  162. key |= ( 1 << 9 );
  163. show_menu ( id, key, menu_body ); // Show the above menu on screen
  164. return PLUGIN_HANDLED;
  165.  
  166. }
  167.  
  168. public radiocmd ( id, key, commandsArray[][64], wavsArray[][] ) {
  169.  
  170. if ( !get_cvar_num ( "amx_custom_radio" ) ) //Check that we're ready to go.
  171. return PLUGIN_CONTINUE;
  172.  
  173. if ( is_user_alive ( id ) == 0 ) return PLUGIN_HANDLED; //Dead people don't talk.
  174.  
  175. if ( g_RadioTimer[id] == 1 ) return PLUGIN_HANDLED; //Wait until you're finished, dawg!
  176.  
  177. new players[32], name[32], team_name[10], total;
  178.  
  179. get_user_team ( id, team_name, 9 );
  180.  
  181. get_players ( players, total , "ce", team_name ) // No bots and Match team name
  182. get_user_name ( id, name, 31 );
  183.  
  184. if ( get_cvar_num ( "amx_real_radio" ) ) {
  185. emit_sound ( id, CHAN_VOICE, wavsArray[key] , 0.9, ATTN_STATIC, 0, PITCH_NORM ) // Play sounds
  186. }
  187.  
  188. for ( new a = 0, player = 0, message[64]; a < total; ++a ) {
  189. player = players[a];
  190. message = commandsArray[key];
  191.  
  192. client_cmd ( player, "spk ^"%s^"", wavsArray[key] );
  193. client_print ( player, print_chat, "%s (RADIO): %s", name, message );
  194. g_RadioTimer[id] = 1;
  195.  
  196. set_task ( 1.0, "radiotimer", id );
  197. }
  198.  
  199. return PLUGIN_HANDLED;
  200. }
  201.  
  202. public radio1 ( id ) { // Client used Radio1 commands
  203. return radio ( id, "Radio Commands A", Radio1Cmds, Radio1Commands );
  204. }
  205.  
  206. public radio1cmd ( id, key ) {
  207. return radiocmd ( id, key, Radio1Commands, Radio1Wavs );
  208. }
  209.  
  210. public radio2 ( id ) { // Client used Radio2 commands
  211. return radio ( id, "Radio Commands B", Radio2Cmds, Radio2Commands );
  212. }
  213.  
  214. public radio2cmd ( id, key ) {
  215. return radiocmd ( id, key, Radio2Commands, Radio2Wavs );
  216. }
  217.  
  218. public radio3 ( id ) { // Client used Radio3 commands
  219. return radio ( id, "Radio Commands C", Radio3Cmds, Radio3Commands );
  220. }
  221.  
  222. public radio3cmd ( id, key ) {
  223. return radiocmd ( id, key, Radio3Commands, Radio3Wavs );
  224. }
  225.  
  226. public radio4 ( id ) { // Client used Radio4 commands
  227. return radio ( id, "Radio Commands D", Radio4Cmds, Radio4Commands );
  228. }
  229.  
  230. public radio4cmd ( id, key ) {
  231. return radiocmd ( id, key, Radio4Commands, Radio4Wavs );
  232. }
  233.  
  234.  
  235.  
  236.  
  237. public register_plugin_clcmds() {
  238. register_clcmd ( "radio1", "radio1", 0, "- Calls radio menu 1" );
  239. register_clcmd ( "radio2", "radio2", 0, "- Calls radio menu 2" );
  240. register_clcmd ( "radio3", "radio3", 0, "- Calls radio menu 3" );
  241. register_clcmd ( "radio4", "radio4", 0, "- Calls radio menu 4" );
  242. }
  243.  
  244. public register_plugin_menucmds() {
  245. register_menucmd ( register_menuid ( "Radio Commands A" ), 511, "radio1cmd" );
  246. register_menucmd ( register_menuid ( "Radio Commands B" ), 511, "radio2cmd" );
  247. register_menucmd ( register_menuid ( "Radio Commands C" ), 511, "radio3cmd" );
  248. register_menucmd ( register_menuid ( "Radio Commands D" ), 511, "radio4cmd" );
  249. }
  250.  
  251. public register_plugin_cvars() {
  252. register_cvar ( "amx_custom_radio", "1" );
  253. register_cvar ( "amx_real_radio", "1" );
  254. register_cvar ( "amx_radio_info", "1" );
  255.  
  256. register_cvar ( "amx_radio_cmdsA", "1" );
  257. register_cvar ( "amx_radio_cmdsB", "1" );
  258. register_cvar ( "amx_radio_cmdsC", "1" );
  259. register_cvar ( "amx_radio_cmdsD", "1" );
  260.  
  261. register_cvar ( "RCA1", "radio" );
  262. register_cvar ( "RCA2", "radio" );
  263. register_cvar ( "RCA3", "radio" );
  264. register_cvar ( "RCA4", "radio" );
  265. register_cvar ( "RCA5", "radio" );
  266. register_cvar ( "RCA6", "radio" );
  267. register_cvar ( "RCA7", "radio" );
  268. register_cvar ( "RCA8", "radio" );
  269. register_cvar ( "RCA9", "radio" );
  270.  
  271. register_cvar ( "RCB1", "radio" );
  272. register_cvar ( "RCB2", "radio" );
  273. register_cvar ( "RCB3", "radio" );
  274. register_cvar ( "RCB4", "radio" );
  275. register_cvar ( "RCB5", "radio" );
  276. register_cvar ( "RCB6", "radio" );
  277. register_cvar ( "RCB7", "radio" );
  278. register_cvar ( "RCB8", "radio" );
  279. register_cvar ( "RCB9", "radio" );
  280.  
  281. register_cvar ( "RCC1", "radio" );
  282. register_cvar ( "RCC2", "radio" );
  283. register_cvar ( "RCC3", "radio" );
  284. register_cvar ( "RCC4", "radio" );
  285. register_cvar ( "RCC5", "radio" );
  286. register_cvar ( "RCC6", "radio" );
  287. register_cvar ( "RCC7", "radio" );
  288. register_cvar ( "RCC8", "radio" );
  289. register_cvar ( "RCC9", "radio" );
  290.  
  291. register_cvar ( "RCD1", "radio" );
  292. register_cvar ( "RCD2", "radio" );
  293. register_cvar ( "RCD3", "radio" );
  294. register_cvar ( "RCD4", "radio" );
  295. register_cvar ( "RCD5", "radio" );
  296. register_cvar ( "RCD6", "radio" );
  297. register_cvar ( "RCD7", "radio" );
  298. register_cvar ( "RCD8", "radio" );
  299. register_cvar ( "RCD9", "radio" );
  300.  
  301. register_cvar ( "RCA1Audio", "radio/custom/null.wav" );
  302. register_cvar ( "RCA2Audio", "radio/custom/null.wav" );
  303. register_cvar ( "RCA3Audio", "radio/custom/null.wav" );
  304. register_cvar ( "RCA4Audio", "radio/custom/null.wav" );
  305. register_cvar ( "RCA5Audio", "radio/custom/null.wav" );
  306. register_cvar ( "RCA6Audio", "radio/custom/null.wav" );
  307. register_cvar ( "RCA7Audio", "radio/custom/null.wav" );
  308. register_cvar ( "RCA8Audio", "radio/custom/null.wav" );
  309. register_cvar ( "RCA9Audio", "radio/custom/null.wav" );
  310.  
  311. register_cvar ( "RCB1Audio", "radio/custom/null.wav" );
  312. register_cvar ( "RCB2Audio", "radio/custom/null.wav" );
  313. register_cvar ( "RCB3Audio", "radio/custom/null.wav" );
  314. register_cvar ( "RCB4Audio", "radio/custom/null.wav" );
  315. register_cvar ( "RCB5Audio", "radio/custom/null.wav" );
  316. register_cvar ( "RCB6Audio", "radio/custom/null.wav" );
  317. register_cvar ( "RCB7Audio", "radio/custom/null.wav" );
  318. register_cvar ( "RCB8Audio", "radio/custom/null.wav" );
  319. register_cvar ( "RCB9Audio", "radio/custom/null.wav" );
  320.  
  321. register_cvar ( "RCC1Audio", "radio/custom/null.wav" );
  322. register_cvar ( "RCC2Audio", "radio/custom/null.wav" );
  323. register_cvar ( "RCC3Audio", "radio/custom/null.wav" );
  324. register_cvar ( "RCC4Audio", "radio/custom/null.wav" );
  325. register_cvar ( "RCC5Audio", "radio/custom/null.wav" );
  326. register_cvar ( "RCC6Audio", "radio/custom/null.wav" );
  327. register_cvar ( "RCC7Audio", "radio/custom/null.wav" );
  328. register_cvar ( "RCC8Audio", "radio/custom/null.wav" );
  329. register_cvar ( "RCC9Audio", "radio/custom/null.wav" );
  330.  
  331. register_cvar ( "RCD1Audio", "radio/custom/null.wav" );
  332. register_cvar ( "RCD2Audio", "radio/custom/null.wav" );
  333. register_cvar ( "RCD3Audio", "radio/custom/null.wav" );
  334. register_cvar ( "RCD4Audio", "radio/custom/null.wav" );
  335. register_cvar ( "RCD5Audio", "radio/custom/null.wav" );
  336. register_cvar ( "RCD6Audio", "radio/custom/null.wav" );
  337. register_cvar ( "RCD7Audio", "radio/custom/null.wav" );
  338. register_cvar ( "RCD8Audio", "radio/custom/null.wav" );
  339. register_cvar ( "RCD9Audio", "radio/custom/null.wav" );
  340.  
  341. register_cvar ( "CRexit", "radio" );
  342. register_cvar ( "CRcolortitle", "r" );
  343. register_cvar ( "CRcolormenu", "w" );
  344.  
  345. register_cvar ( "CRfireinhole", "radio" );
  346. }
  347.  
  348. public register_plugin_messages() {
  349. register_message ( get_user_msgid ( "TextMsg" ), "message" );
  350. register_message ( get_user_msgid ( "SendAudio" ), "msg_audio" );
  351. }
  352.  
  353. public server_exec_plugin_cfg() {
  354. new configsDir[64];
  355. get_configsdir ( configsDir, 63 );
  356.  
  357. server_cmd ( "exec %s/custom_radio.cfg", configsDir );
  358. server_exec();
  359. }
  360.  
  361. public read_custom_radio_cfg() {
  362.  
  363. Radio1Cmds = get_cvar_num ( "amx_radio_cmdsA" );
  364. Radio2Cmds = get_cvar_num ( "amx_radio_cmdsB" );
  365. Radio3Cmds = get_cvar_num ( "amx_radio_cmdsC" );
  366. Radio4Cmds = get_cvar_num ( "amx_radio_cmdsD" );
  367.  
  368. get_cvar_string ( "RCA1", Radio1Commands[0], 63 );
  369. get_cvar_string ( "RCA2", Radio1Commands[1], 63 );
  370. get_cvar_string ( "RCA3", Radio1Commands[2], 63 );
  371. get_cvar_string ( "RCA4", Radio1Commands[3], 63 );
  372. get_cvar_string ( "RCA5", Radio1Commands[4], 63 );
  373. get_cvar_string ( "RCA6", Radio1Commands[5], 63 );
  374. get_cvar_string ( "RCA7", Radio1Commands[6], 63 );
  375. get_cvar_string ( "RCA8", Radio1Commands[7], 63 );
  376. get_cvar_string ( "RCA9", Radio1Commands[8], 63 );
  377.  
  378. get_cvar_string ( "RCB1", Radio2Commands[0], 63 );
  379. get_cvar_string ( "RCB2", Radio2Commands[1], 63 );
  380. get_cvar_string ( "RCB3", Radio2Commands[2], 63 );
  381. get_cvar_string ( "RCB4", Radio2Commands[3], 63 );
  382. get_cvar_string ( "RCB5", Radio2Commands[4], 63 );
  383. get_cvar_string ( "RCB6", Radio2Commands[5], 63 );
  384. get_cvar_string ( "RCB7", Radio2Commands[6], 63 );
  385. get_cvar_string ( "RCB8", Radio2Commands[7], 63 );
  386. get_cvar_string ( "RCB9", Radio2Commands[8], 63 );
  387.  
  388. get_cvar_string ( "RCC1", Radio3Commands[0], 63 );
  389. get_cvar_string ( "RCC2", Radio3Commands[1], 63 );
  390. get_cvar_string ( "RCC3", Radio3Commands[2], 63 );
  391. get_cvar_string ( "RCC4", Radio3Commands[3], 63 );
  392. get_cvar_string ( "RCC5", Radio3Commands[4], 63 );
  393. get_cvar_string ( "RCC6", Radio3Commands[5], 63 );
  394. get_cvar_string ( "RCC7", Radio3Commands[6], 63 );
  395. get_cvar_string ( "RCC8", Radio3Commands[7], 63 );
  396. get_cvar_string ( "RCC9", Radio3Commands[8], 63 );
  397.  
  398. get_cvar_string ( "RCD1", Radio4Commands[0], 63 );
  399. get_cvar_string ( "RCD2", Radio4Commands[1], 63 );
  400. get_cvar_string ( "RCD3", Radio4Commands[2], 63 );
  401. get_cvar_string ( "RCD4", Radio4Commands[3], 63 );
  402. get_cvar_string ( "RCD5", Radio4Commands[4], 63 );
  403. get_cvar_string ( "RCD6", Radio4Commands[5], 63 );
  404. get_cvar_string ( "RCD7", Radio4Commands[6], 63 );
  405. get_cvar_string ( "RCD8", Radio4Commands[7], 63 );
  406. get_cvar_string ( "RCD9", Radio4Commands[8], 63 );
  407.  
  408. get_cvar_string ( "RCA1Audio", Radio1Wavs[0], 63 );
  409. get_cvar_string ( "RCA2Audio", Radio1Wavs[1], 63 );
  410. get_cvar_string ( "RCA3Audio", Radio1Wavs[2], 63 );
  411. get_cvar_string ( "RCA4Audio", Radio1Wavs[3], 63 );
  412. get_cvar_string ( "RCA5Audio", Radio1Wavs[4], 63 );
  413. get_cvar_string ( "RCA6Audio", Radio1Wavs[5], 63 );
  414. get_cvar_string ( "RCA7Audio", Radio1Wavs[6], 63 );
  415. get_cvar_string ( "RCA8Audio", Radio1Wavs[7], 63 );
  416. get_cvar_string ( "RCA9Audio", Radio1Wavs[8], 63 );
  417.  
  418. get_cvar_string ( "RCB1Audio", Radio2Wavs[0], 63 );
  419. get_cvar_string ( "RCB2Audio", Radio2Wavs[1], 63 );
  420. get_cvar_string ( "RCB3Audio", Radio2Wavs[2], 63 );
  421. get_cvar_string ( "RCB4Audio", Radio2Wavs[3], 63 );
  422. get_cvar_string ( "RCB5Audio", Radio2Wavs[4], 63 );
  423. get_cvar_string ( "RCB6Audio", Radio2Wavs[5], 63 );
  424. get_cvar_string ( "RCB7Audio", Radio2Wavs[6], 63 );
  425. get_cvar_string ( "RCB8Audio", Radio2Wavs[7], 63 );
  426. get_cvar_string ( "RCB9Audio", Radio2Wavs[8], 63 );
  427.  
  428. get_cvar_string ( "RCC1Audio", Radio3Wavs[0], 63 );
  429. get_cvar_string ( "RCC2Audio", Radio3Wavs[1], 63 );
  430. get_cvar_string ( "RCC3Audio", Radio3Wavs[2], 63 );
  431. get_cvar_string ( "RCC4Audio", Radio3Wavs[3], 63 );
  432. get_cvar_string ( "RCC5Audio", Radio3Wavs[4], 63 );
  433. get_cvar_string ( "RCC6Audio", Radio3Wavs[5], 63 );
  434. get_cvar_string ( "RCC7Audio", Radio3Wavs[6], 63 );
  435. get_cvar_string ( "RCC8Audio", Radio3Wavs[7], 63 );
  436. get_cvar_string ( "RCC9Audio", Radio3Wavs[8], 63 );
  437.  
  438. get_cvar_string ( "RCD1Audio", Radio4Wavs[0], 63 );
  439. get_cvar_string ( "RCD2Audio", Radio4Wavs[1], 63 );
  440. get_cvar_string ( "RCD3Audio", Radio4Wavs[2], 63 );
  441. get_cvar_string ( "RCD4Audio", Radio4Wavs[3], 63 );
  442. get_cvar_string ( "RCD5Audio", Radio4Wavs[4], 63 );
  443. get_cvar_string ( "RCD6Audio", Radio4Wavs[5], 63 );
  444. get_cvar_string ( "RCD7Audio", Radio4Wavs[6], 63 );
  445. get_cvar_string ( "RCD8Audio", Radio4Wavs[7], 63 );
  446. get_cvar_string ( "RCD9Audio", Radio4Wavs[8], 63 );
  447.  
  448. get_cvar_string ( "CRexit", CRexit, 63 );
  449. get_cvar_string ( "CRcolortitle", CRcolortitle, 1 );
  450. get_cvar_string ( "CRcolormenu", CRcolormenu, 1 );
  451.  
  452. //version 0.6
  453. get_cvar_string ( "CRfireinhole", CRfireinhole, 63 );
  454.  
  455. }
  456.  
  457. /* Since we need to precache stuff we find,
  458. everything must be started here. Well...not everything, but, for me,
  459. it's easier if we just initialize everything here.
  460. */
  461. public start_plugin() {
  462. register_plugin_clcmds();
  463. register_plugin_menucmds();
  464.  
  465. register_plugin_cvars();
  466. register_plugin_messages();
  467.  
  468. server_exec_plugin_cfg();
  469. read_custom_radio_cfg();
  470. }
  471.  
  472. public plugin_precache() {
  473. start_plugin();
  474.  
  475. for ( new i ; i < Radio1Cmds ; i++ ) {
  476. precache_sound ( Radio1Wavs[i] );
  477. }
  478.  
  479. for ( new i ; i < Radio2Cmds ; i++ ) {
  480. precache_sound ( Radio2Wavs[i] );
  481. }
  482.  
  483. for ( new i ; i < Radio3Cmds ; i++ ) {
  484. precache_sound ( Radio3Wavs[i] );
  485. }
  486.  
  487. for ( new i ; i < Radio4Cmds ; i++ ) {
  488. precache_sound ( Radio4Wavs[i] );
  489. }
  490.  
  491. precache_sound ( "radio/custom/null.wav" );
  492.  
  493. precache_sound ( "radio/custom/ct_fireinhole.wav" );
  494.  
  495. }
  496.  
  497.  
  498.  
  499. public plugin_init() {
  500. register_plugin ( PLUGIN, VERSION, AUTHOR );
  501.  
  502. return PLUGIN_CONTINUE;
  503. }
  504.  
  505. public plugin_cfg() {}
  506.  
  507. public message() {
  508. if ( !get_cvar_num ( "amx_custom_radio" ) )
  509. return PLUGIN_CONTINUE;
  510.  
  511. if ( get_msg_args() != 4 || get_msg_argtype ( 2 ) != ARG_STRING || get_msg_argtype ( 4 ) != ARG_STRING ) {
  512. return PLUGIN_CONTINUE;
  513. }
  514.  
  515. new arg2[16]
  516.  
  517. get_msg_arg_string ( 2, arg2, 15 )
  518.  
  519. if ( !equal ( arg2, "#Game_radio" ) ) {
  520. return PLUGIN_CONTINUE;
  521. }
  522.  
  523. new arg4[20]
  524.  
  525. get_msg_arg_string ( 4, arg4, 19 )
  526.  
  527. if ( equal ( arg4, "#Fire_in_the_hole" ) ) {
  528. set_msg_arg_string ( 4, CRfireinhole )
  529. return PLUGIN_CONTINUE;
  530. }
  531.  
  532. return PLUGIN_CONTINUE;
  533. }
  534.  
  535. public msg_audio() {
  536. if ( !get_cvar_num ( "amx_custom_radio" ) )
  537. return PLUGIN_CONTINUE;
  538.  
  539. if ( get_msg_args() != 3 || get_msg_argtype ( 2 ) != ARG_STRING ) {
  540. return PLUGIN_CONTINUE;
  541. }
  542.  
  543. new arg2[20];
  544.  
  545. get_msg_arg_string ( 2, arg2, 19 );
  546.  
  547. if ( equal ( arg2[1], "!MRAD_FIREINHOLE" ) ) {
  548. return PLUGIN_HANDLED;
  549. }
  550.  
  551. return PLUGIN_CONTINUE;
  552. }
  553.  
  554. public grenade_throw ( id, ent, wid ) {
  555. if ( !get_cvar_num ( "amx_custom_radio" ) )
  556. return PLUGIN_CONTINUE;
  557.  
  558. new players[32], total, team_name[10];
  559.  
  560. get_user_team ( id, team_name, 9 );
  561.  
  562. get_players ( players, total , "ce", team_name ) // No bots and Match team name
  563. new name[32];
  564.  
  565. get_user_name ( id, name, 31 );
  566.  
  567. for ( new a = 0; a < total; ++a ) {
  568. client_cmd ( players[a], "spk radio/custom/ct_fireinhole.wav" );
  569.  
  570. if ( get_cvar_num ( "amx_real_radio" ) ) {
  571. emit_sound ( id, CHAN_VOICE, "radio/custom/ct_fireinhole.wav" , 0.9, ATTN_STATIC, 0, PITCH_NORM );
  572. }
  573. }
  574.  
  575. return PLUGIN_HANDLED;
  576. }
  577.  
  578. public radiotimer ( id ) {
  579. g_RadioTimer[id] = 0;
  580. return PLUGIN_HANDLED;
  581. }
  582.  
  583. public client_connect ( id ) {
  584. g_RadioTimer[id] = 0;
  585. }
  586.  
  587. public client_disconnect ( id ) {
  588. g_RadioTimer[id] = 0;
  589. }
  590.  
  591.  
  592. public client_putinserver ( id ) {
  593. set_task ( 20.0, "dispInfo", id );
  594. }
  595.  
  596. public dispInfo ( id ) {
  597. if ( get_cvar_num ( "amx_radio_info" ) ) {
  598. client_print ( id, print_chat, "Advanced Radio plugin is running on this server." );
  599. client_print ( id, print_chat, "It is brought to you by: Joao Ricardo Lourenco (jorl17.8@gmail.com)." );
  600. client_print ( id, print_chat, "Portions of this code were written by KaLoSZyFeR (kaloszyfer@o2.pl)." );
  601. }
  602. }
  603.  

_________________
Ha elnyerte valamelyik témában a hozzászólásom a tetszésedet melyet olvastál, akkor egy egyszerű gombnyomással kifejezheted, hogy tetszett.


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  [2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 33 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