Advertisement
mihay111

zecustomradio

Jul 21st, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.27 KB | None | 0 0
  1. #include <zombie_escape>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <csx>
  5.  
  6.  
  7. #define PLUGIN "Custom Radio Commands"
  8. #define VERSION "0.6"
  9. #define AUTHOR "KaLoSZyFeR"
  10.  
  11.  
  12. new g_RadioTimer[33]
  13.  
  14. /* CONFIG SETUP */
  15. new CRcoverme[64]
  16. new CRtakepoint[64]
  17. new CRhposition[64]
  18. new CRregroup[64]
  19. new CRfollowme[64]
  20. new CRfireassis[64]
  21.  
  22. new CRgo[64]
  23. new CRfallback[64]
  24. new CRsticktog[64]
  25. new CRgetinpos[64]
  26. new CRstormfront[64]
  27. new CRreportin[64]
  28.  
  29. new CRroger[64]
  30. new CRenemys[64]
  31. new CRbackup[64]
  32. new CRclear[64]
  33. new CRposition[64]
  34. new CRreportingin[64]
  35. new CRgetoutblow[64]
  36. new CRnegative[64]
  37. new CRenemydown[64]
  38.  
  39. new CRexit[64]
  40. new CRcolortitle[2]
  41. new CRcolormenu[2]
  42.  
  43. //version 0.6
  44. new CRfireinhole[64]
  45.  
  46. // Radio1 wav files
  47. stock const radio1_spk[6][] ={
  48. "radio/ze_radio/ct_coverme.wav",
  49. "radio/ze_radio/takepoint.wav",
  50. "radio/ze_radio/position.wav",
  51. "radio/ze_radio/regroup.wav",
  52. "radio/ze_radio/followme.wav",
  53. "radio/ze_radio/fireassis.wav"
  54. }
  55.  
  56.  
  57. public radio1(id) { // Client used Radio1 commands
  58. if(!get_cvar_num("amx_custom_radio"))
  59. return PLUGIN_CONTINUE
  60.  
  61. if(is_user_alive(id) == 0 || ze_is_user_zombie(id)) return PLUGIN_HANDLED
  62. // What Radio1 menu will look like
  63. new key1 = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<9)
  64.  
  65. new menu_body1[512]
  66. new len1 = format(menu_body1,511,"\%sRadio Commands A\%s^n\ ", CRcolortitle, CRcolormenu)
  67. len1 += format( menu_body1[len1], 511-len1, "^n\ " )
  68. len1 += format( menu_body1[len1], 511-len1, "1. %s^n\ ", CRcoverme)
  69. len1 += format( menu_body1[len1], 511-len1, "2. %s^n\ ", CRtakepoint)
  70. len1 += format( menu_body1[len1], 511-len1, "3. %s^n\ ", CRhposition)
  71. len1 += format( menu_body1[len1], 511-len1, "4. %s^n\ ", CRregroup)
  72. len1 += format( menu_body1[len1], 511-len1, "5. %s^n\ ", CRfollowme)
  73. len1 += format( menu_body1[len1], 511-len1, "6. %s^n\ ", CRfireassis)
  74. len1 += format( menu_body1[len1], 511-len1, "^n\ " )
  75. len1 += format( menu_body1[len1], 511-len1, "0. %s", CRexit)
  76. show_menu(id,key1,menu_body1) // Show the above menu on screen
  77. return PLUGIN_HANDLED
  78. }
  79.  
  80. public radio1cmd(id, key1) {
  81. if(!get_cvar_num("amx_custom_radio"))
  82. return PLUGIN_CONTINUE
  83.  
  84. if(is_user_alive(id) == 0 || ze_is_user_zombie(id)) return PLUGIN_HANDLED
  85. if(g_RadioTimer[id] == 1) return PLUGIN_HANDLED
  86. new players[32],total, team_name[10]
  87. get_user_team(id,team_name, 9)
  88. get_players(players, total ,"ce", team_name) // No bots and Match team name
  89. new name[32]
  90. get_user_name(id,name,31)
  91. for(new a=0; a < total; ++a) {
  92. client_cmd(players[a], "spk ^"%s^"", radio1_spk[key1])
  93. if (get_cvar_num("amx_real_radio"))
  94. {
  95. emit_sound(id, CHAN_VOICE, radio1_spk[key1] , 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
  96. }
  97. //client_print(players[a],print_chat,"%s (RADIO): %s",name, radio1_say[key1])
  98. new message1[64]
  99.  
  100. switch (key1) {
  101. case 0: { // 1
  102. message1 = CRcoverme
  103. }
  104. case 1: { // 2
  105. message1 = CRtakepoint
  106. }
  107. case 2: { // 3
  108. message1 = CRhposition
  109. }
  110. case 3: { // 4
  111. message1 = CRregroup
  112. }
  113. case 4: { // 5
  114. message1 = CRfollowme
  115. }
  116. case 5: { // 6
  117. message1 = CRfireassis
  118. }
  119. }
  120. client_print(players[a],print_chat,"%s (RADIO): %s",name, message1)
  121. g_RadioTimer[id] = 1
  122. set_task(2.0,"radiotimer",id)
  123. }
  124. return PLUGIN_HANDLED
  125. }
  126.  
  127.  
  128.  
  129. // Radio2 wav files
  130.  
  131. stock const radio2_spk[6][] = {
  132.  
  133.  
  134. "radio/ze_radio/com_go.wav",
  135. "radio/ze_radio/fallback.wav",
  136. "radio/ze_radio/sticktog.wav",
  137. "radio/ze_radio/com_getinpos.wav",
  138. "radio/ze_radio/stormfront.wav",
  139. "radio/ze_radio/com_reportin.wav"
  140. }
  141.  
  142. public radio2(id) { // Client used Radio2 commands
  143. if(!get_cvar_num("amx_custom_radio"))
  144. return PLUGIN_CONTINUE
  145.  
  146. if(is_user_alive(id) == 0 || ze_is_user_zombie(id)) return PLUGIN_HANDLED
  147. // What Radio2 menu will look like
  148. new key2 = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<9)
  149.  
  150. new menu_body2[512]
  151. new len2 = format(menu_body2,511,"\%sRadio Commands B\%s^n\ ", CRcolortitle, CRcolormenu)
  152. len2 += format( menu_body2[len2], 511-len2, "^n\ " )
  153. len2 += format( menu_body2[len2], 511-len2, "1. %s^n\ ", CRgo)
  154. len2 += format( menu_body2[len2], 511-len2, "2. %s^n\ ", CRfallback)
  155. len2 += format( menu_body2[len2], 511-len2, "3. %s^n\ ", CRsticktog)
  156. len2 += format( menu_body2[len2], 511-len2, "4. %s^n\ ", CRgetinpos)
  157. len2 += format( menu_body2[len2], 511-len2, "5. %s^n\ ", CRstormfront)
  158. len2 += format( menu_body2[len2], 511-len2, "6. %s^n\ ", CRreportin)
  159. len2 += format( menu_body2[len2], 511-len2, "^n\ " )
  160. len2 += format( menu_body2[len2], 511-len2, "0. %s", CRexit)
  161.  
  162. show_menu(id,key2,menu_body2) // Show the above menu on screen
  163. return PLUGIN_HANDLED
  164. }
  165.  
  166. public radio2cmd(id, key2) {
  167. if(!get_cvar_num("amx_custom_radio"))
  168. return PLUGIN_CONTINUE
  169.  
  170. if(is_user_alive(id) == 0 || ze_is_user_zombie(id)) return PLUGIN_HANDLED
  171. if(g_RadioTimer[id] == 1) return PLUGIN_HANDLED
  172. new players2[32],total2, team_name2[10]
  173. get_user_team(id,team_name2, 9)
  174. get_players(players2, total2 ,"ce", team_name2) // No bots and Match team name
  175. new name2[32]
  176. get_user_name(id,name2,31)
  177. for(new a2=0; a2 < total2; ++a2) {
  178. client_cmd(players2[a2], "spk ^"%s^"", radio2_spk[key2])
  179. if (get_cvar_num("amx_real_radio"))
  180. {
  181. emit_sound(id, CHAN_VOICE, radio2_spk[key2] , 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
  182. }
  183. //client_print(players2[a2],print_chat,"%s (RADIO): %s",name2,radio2_say[key2]) // Print radio message on screen
  184. new message2[64]
  185.  
  186. switch (key2) {
  187. case 0: { // 1
  188. message2 = CRgo
  189. }
  190. case 1: { // 2
  191. message2 = CRfallback
  192. }
  193. case 2: { // 3
  194. message2 = CRsticktog
  195. }
  196. case 3: { // 4
  197. message2 = CRgetinpos
  198. }
  199. case 4: { // 5
  200. message2 = CRstormfront
  201. }
  202. case 5: { // 6
  203. message2 = CRreportin
  204. }
  205. }
  206. client_print(players2[a2],print_chat,"%s (RADIO): %s",name2, message2)
  207. g_RadioTimer[id] = 1
  208. set_task(2.0,"radiotimer",id)
  209. }
  210. return PLUGIN_HANDLED
  211. }
  212.  
  213.  
  214. // Radio3 wav files
  215.  
  216. stock const radio3_spk[9][] = {
  217.  
  218.  
  219. "radio/ze_radio/roger.wav",
  220. "radio/ze_radio/ct_enemys.wav",
  221. "radio/ze_radio/ct_backup.wav",
  222. "radio/ze_radio/clear.wav",
  223. "radio/ze_radio/ct_inpos.wav",
  224. "radio/ze_radio/ct_reportingin.wav",
  225. "radio/ze_radio/blow.wav",
  226. "radio/ze_radio/negative.wav",
  227. "radio/ze_radio/enemydown.wav"
  228. }
  229.  
  230. public radio3(id) { // Client used Radio3 commands
  231. if(!get_cvar_num("amx_custom_radio"))
  232. return PLUGIN_CONTINUE
  233.  
  234. if(is_user_alive(id) == 0 || ze_is_user_zombie(id)) return PLUGIN_HANDLED
  235. // What Radio3 menu will look like
  236. new key3 = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
  237.  
  238. new menu_body3[512]
  239. new len3 = format(menu_body3,511,"\%sRadio Commands C\%s^n\ ", CRcolortitle, CRcolormenu)
  240. len3 += format( menu_body3[len3], 511-len3, "^n\ " )
  241. len3 += format( menu_body3[len3], 511-len3, "1. %s^n\ ", CRroger)
  242. len3 += format( menu_body3[len3], 511-len3, "2. %s^n\ ", CRenemys)
  243. len3 += format( menu_body3[len3], 511-len3, "3. %s^n\ ", CRbackup)
  244. len3 += format( menu_body3[len3], 511-len3, "4. %s^n\ ", CRclear)
  245. len3 += format( menu_body3[len3], 511-len3, "5. %s^n\ ", CRposition)
  246. len3 += format( menu_body3[len3], 511-len3, "6. %s^n\ ", CRreportingin)
  247. len3 += format( menu_body3[len3], 511-len3, "7. %s^n\ ", CRgetoutblow)
  248. len3 += format( menu_body3[len3], 511-len3, "8. %s^n\ ", CRnegative)
  249. len3 += format( menu_body3[len3], 511-len3, "9. %s^n\ ", CRenemydown)
  250. len3 += format( menu_body3[len3], 511-len3, "^n\ " )
  251. len3 += format( menu_body3[len3], 511-len3, "0. %s", CRexit)
  252.  
  253. show_menu(id,key3,menu_body3) // Show the above menu on screen
  254. return PLUGIN_HANDLED
  255. }
  256.  
  257. public radio3cmd(id, key3) {
  258. if(!get_cvar_num("amx_custom_radio"))
  259. return PLUGIN_CONTINUE
  260.  
  261. if(is_user_alive(id) == 0 || ze_is_user_zombie(id)) return PLUGIN_HANDLED
  262. if(g_RadioTimer[id] == 1) return PLUGIN_HANDLED
  263. new players3[32],total3, team_name3[10]
  264. get_user_team(id,team_name3, 9)
  265. get_players(players3, total3 ,"ce", team_name3) // No bots and Match team name
  266. new name3[32]
  267. get_user_name(id,name3,31)
  268. for(new a3=0; a3 < total3; ++a3) {
  269. client_cmd(players3[a3], "spk ^"%s^"", radio3_spk[key3])
  270. if (get_cvar_num("amx_real_radio"))
  271. {
  272. emit_sound(id, CHAN_VOICE, radio3_spk[key3] , 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
  273. }
  274. //client_print(players3[a3],print_chat,"%s (RADIO): %s",name3,radio3_say[key3]) // Print radio message on screen
  275. new message3[64]
  276.  
  277. switch (key3) {
  278. case 0: { // 1
  279. message3 = CRroger
  280. }
  281. case 1: { // 2
  282. message3 = CRenemys
  283. }
  284. case 2: { // 3
  285. message3 = CRbackup
  286. }
  287. case 3: { // 4
  288. message3 = CRclear
  289. }
  290. case 4: { // 5
  291. message3 = CRposition
  292. }
  293. case 5: { // 6
  294. message3 = CRreportingin
  295. }
  296. case 6: { // 7
  297. message3 = CRgetoutblow
  298. }
  299. case 7: { // 8
  300. message3 = CRnegative
  301. }
  302. case 8: { // 9
  303. message3 = CRenemydown
  304. }
  305. }
  306. client_print(players3[a3],print_chat,"%s (RADIO): %s",name3, message3)
  307.  
  308. g_RadioTimer[id] = 1
  309. set_task(2.0,"radiotimer",id)
  310. }
  311. return PLUGIN_HANDLED
  312. }
  313.  
  314.  
  315. public plugin_precache() {
  316.  
  317. precache_sound(radio1_spk[0])
  318. precache_sound(radio1_spk[1])
  319. precache_sound(radio1_spk[2])
  320. precache_sound(radio1_spk[3])
  321. precache_sound(radio1_spk[4])
  322. precache_sound(radio1_spk[5])
  323.  
  324. precache_sound(radio2_spk[0])
  325. precache_sound(radio2_spk[1])
  326. precache_sound(radio2_spk[2])
  327. precache_sound(radio2_spk[3])
  328. precache_sound(radio2_spk[4])
  329. precache_sound(radio2_spk[5])
  330.  
  331. precache_sound(radio3_spk[0])
  332. precache_sound(radio3_spk[1])
  333. precache_sound(radio3_spk[2])
  334. precache_sound(radio3_spk[3])
  335. precache_sound(radio3_spk[4])
  336. precache_sound(radio3_spk[5])
  337. precache_sound(radio3_spk[6])
  338. precache_sound(radio3_spk[7])
  339. precache_sound(radio3_spk[8])
  340.  
  341. precache_sound("radio/ze_radio/roger.wav")
  342.  
  343. return PLUGIN_CONTINUE
  344. }
  345.  
  346. public plugin_init(){
  347.  
  348. register_plugin(PLUGIN, VERSION, AUTHOR)
  349.  
  350. register_clcmd("radio1", "radio1", 0, "- Calls radio menu 1")
  351. register_clcmd("radio2", "radio2", 0, "- Calls radio menu 2")
  352. register_clcmd("radio3", "radio3", 0, "- Calls radio menu 3")
  353. register_menucmd(register_menuid("Radio Commands A"),511,"radio1cmd")
  354. register_menucmd(register_menuid("Radio Commands B"),511,"radio2cmd")
  355. register_menucmd(register_menuid("Radio Commands C"),511,"radio3cmd")
  356.  
  357. register_cvar("amx_custom_radio", "1")
  358. register_cvar("amx_real_radio", "1")
  359. register_cvar("amx_radio_info", "1")
  360.  
  361. register_cvar("CRcoverme", "radio")
  362. register_cvar("CRtakepoint", "radio")
  363. register_cvar("CRhposition", "radio")
  364. register_cvar("CRregroup", "radio")
  365. register_cvar("CRfollowme", "radio")
  366. register_cvar("CRfireassis", "radio")
  367.  
  368. register_cvar("CRgo", "radio")
  369. register_cvar("CRfallback", "radio")
  370. register_cvar("CRsticktog", "radio")
  371. register_cvar("CRgetinpos", "radio")
  372. register_cvar("CRstormfront", "radio")
  373. register_cvar("CRreportin", "radio")
  374.  
  375. register_cvar("CRroger", "radio")
  376. register_cvar("CRenemys", "radio")
  377. register_cvar("CRbackup", "radio")
  378. register_cvar("CRclear", "radio")
  379. register_cvar("CRposition", "radio")
  380. register_cvar("CRreportingin", "radio")
  381. register_cvar("CRgetoutblow", "radio")
  382. register_cvar("CRnegative", "radio")
  383. register_cvar("CRenemydown", "radio")
  384.  
  385. register_cvar("CRexit", "radio")
  386. register_cvar("CRcolortitle", "r")
  387. register_cvar("CRcolormenu", "w")
  388.  
  389. register_cvar("CRfireinhole", "radio")
  390.  
  391. register_message(get_user_msgid("TextMsg"), "message")
  392. register_message(get_user_msgid("SendAudio"), "msg_audio")
  393.  
  394. //version 0.6
  395. register_clcmd("coverme", "komenda", 0, "- Quick radio command")
  396. register_clcmd("takepoint", "komenda", 0, "- Quick radio command")
  397. register_clcmd("holdpos", "komenda", 0, "- Quick radio command")
  398. register_clcmd("regroup", "komenda", 0, "- Quick radio command")
  399. register_clcmd("followme", "komenda", 0, "- Quick radio command")
  400. register_clcmd("takingfire", "komenda", 0, "- Quick radio command")
  401.  
  402. register_clcmd("go", "komenda", 0, "- Quick radio command")
  403. register_clcmd("fallback", "komenda", 0, "- Quick radio command")
  404. register_clcmd("sticktog", "komenda", 0, "- Quick radio command")
  405. register_clcmd("getinpos", "komenda", 0, "- Quick radio command")
  406. register_clcmd("stormfront", "komenda", 0, "- Quick radio command")
  407. register_clcmd("report", "komenda", 0, "- Quick radio command")
  408.  
  409. register_clcmd("roger", "komenda", 0, "- Quick radio command")
  410. register_clcmd("enemyspot", "komenda", 0, "- Quick radio command")
  411. register_clcmd("needbackup", "komenda", 0, "- Quick radio command")
  412. register_clcmd("sectorclear", "komenda", 0, "- Quick radio command")
  413. register_clcmd("inposition", "komenda", 0, "- Quick radio command")
  414. register_clcmd("reportingin", "komenda", 0, "- Quick radio command")
  415. register_clcmd("getout", "komenda", 0, "- Quick radio command")
  416. register_clcmd("negative", "komenda", 0, "- Quick radio command")
  417. register_clcmd("enemydown", "komenda", 0, "- Quick radio command")
  418.  
  419. new configsDir[64]
  420. get_configsdir(configsDir, 63)
  421.  
  422. server_cmd("exec %s/custom_radio.cfg", configsDir)
  423. server_exec()
  424.  
  425. return PLUGIN_CONTINUE
  426. }
  427.  
  428. public message()
  429. {
  430. if(!get_cvar_num("amx_custom_radio"))
  431. return PLUGIN_CONTINUE
  432.  
  433. if(get_msg_args() != 5 || get_msg_argtype(3) != ARG_STRING || get_msg_argtype(5) != ARG_STRING)
  434. {
  435. return PLUGIN_CONTINUE
  436. }
  437.  
  438. new arg2[16]
  439. get_msg_arg_string(3, arg2, 15)
  440. if(!equal(arg2, "#Game_radio"))
  441. {
  442. return PLUGIN_CONTINUE
  443. }
  444.  
  445. new arg4[20]
  446. get_msg_arg_string(5, arg4, 19)
  447. if(equal(arg4, "#Fire_in_the_hole"))
  448. {
  449. set_msg_arg_string(5, CRfireinhole)
  450. return PLUGIN_CONTINUE
  451. }
  452.  
  453. return PLUGIN_CONTINUE
  454. }
  455.  
  456. public msg_audio()
  457. {
  458. if(!get_cvar_num("amx_custom_radio"))
  459. return PLUGIN_CONTINUE
  460.  
  461. if(get_msg_args() != 3 || get_msg_argtype(2) != ARG_STRING) {
  462. return PLUGIN_CONTINUE
  463. }
  464.  
  465. new arg2[20]
  466. get_msg_arg_string(2, arg2, 19)
  467. if(equal(arg2[1], "!MRAD_FIREINHOLE"))
  468. {
  469. return PLUGIN_HANDLED
  470. }
  471.  
  472. return PLUGIN_CONTINUE
  473. }
  474.  
  475. public radiotimer(id) {
  476. g_RadioTimer[id] = 0
  477. return PLUGIN_HANDLED
  478. }
  479.  
  480. public client_connect(id) {
  481. g_RadioTimer[id] = 0
  482. }
  483.  
  484. public client_disconnected(id) {
  485. g_RadioTimer[id] = 0
  486. }
  487.  
  488.  
  489. public client_putinserver(id)
  490. {
  491. set_task(20.0, "dispInfo", id)
  492. }
  493.  
  494. public dispInfo(id)
  495. {
  496. if (get_cvar_num("amx_radio_info"))
  497. //client_print(id,print_chat,"Plugin 'Custom Radio Commands' jest uruchomiony na tym serwerze. Kontakt z autorem: kaloszyfer@o2.pl")
  498. client_print(id,print_chat,"'Custom Radio Commands' plugin is running on this server. Contact with author: kaloszyfer@o2.pl")
  499. }
  500.  
  501. public plugin_cfg()
  502. {
  503.  
  504. get_cvar_string("CRcoverme", CRcoverme, 63)
  505. get_cvar_string("CRtakepoint", CRtakepoint, 63)
  506. get_cvar_string("CRhposition", CRhposition, 63)
  507. get_cvar_string("CRregroup", CRregroup, 63)
  508. get_cvar_string("CRfollowme", CRfollowme, 63)
  509. get_cvar_string("CRfireassis", CRfireassis, 63)
  510.  
  511. get_cvar_string("CRgo", CRgo, 63)
  512. get_cvar_string("CRfallback", CRfallback, 63)
  513. get_cvar_string("CRsticktog", CRsticktog, 63)
  514. get_cvar_string("CRgetinpos", CRgetinpos, 63)
  515. get_cvar_string("CRstormfront", CRstormfront, 63)
  516. get_cvar_string("CRreportin", CRreportin, 63)
  517.  
  518. get_cvar_string("CRroger", CRroger, 63)
  519. get_cvar_string("CRenemys", CRenemys, 63)
  520. get_cvar_string("CRbackup", CRbackup, 63)
  521. get_cvar_string("CRclear", CRclear, 63)
  522. get_cvar_string("CRposition", CRposition, 63)
  523. get_cvar_string("CRreportingin", CRreportingin, 63)
  524. get_cvar_string("CRgetoutblow", CRgetoutblow, 63)
  525. get_cvar_string("CRnegative", CRnegative, 63)
  526. get_cvar_string("CRenemydown", CRenemydown, 63)
  527.  
  528. get_cvar_string("CRexit", CRexit, 63)
  529. get_cvar_string("CRcolortitle", CRcolortitle, 1)
  530. get_cvar_string("CRcolormenu", CRcolormenu, 1)
  531.  
  532. //version 0.6
  533. get_cvar_string("CRfireinhole", CRfireinhole, 63)
  534.  
  535. }
  536.  
  537. //version 0.6
  538. new cmd_radio1[6][] =
  539. {
  540. "coverme",
  541. "takepoint",
  542. "holdpos",
  543. "regroup",
  544. "followme",
  545. "takingfire"
  546. }
  547.  
  548. new cmd_radio2[6][] =
  549. {
  550. "go",
  551. "fallback",
  552. "sticktog",
  553. "getinpos",
  554. "stormfront",
  555. "report"
  556. }
  557.  
  558. new cmd_radio3[9][] =
  559. {
  560. "roger",
  561. "enemyspot",
  562. "needbackup",
  563. "sectorclear",
  564. "inposition",
  565. "reportingin",
  566. "getout",
  567. "negative",
  568. "enemydown"
  569. }
  570.  
  571. public komenda(id)
  572. {
  573. if(!get_cvar_num("amx_custom_radio"))
  574. return PLUGIN_CONTINUE
  575.  
  576. new komenda[16]
  577. read_argv ( 0, komenda, 15 )
  578.  
  579. for(new i = 0; i < 6; i++)
  580. {
  581. if(equal(komenda, cmd_radio1[i]))
  582. {
  583. if(is_user_alive(id) == 0 || ze_is_user_zombie(id))
  584. return PLUGIN_HANDLED
  585. if(g_RadioTimer[id] == 1)
  586. return PLUGIN_HANDLED
  587.  
  588. new players[32],total, team_name[10]
  589. get_user_team(id,team_name, 9)
  590. get_players(players, total ,"ce", team_name) // No bots and Match team name
  591. new name[32]
  592. get_user_name(id,name,31)
  593. for(new a=0; a < total; ++a)
  594. {
  595. client_cmd(players[a], "spk ^"%s^"", radio1_spk[i])
  596. if (get_cvar_num("amx_real_radio"))
  597. {
  598. emit_sound(id, CHAN_VOICE, radio1_spk[i] , 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
  599. }
  600. new message1[64]
  601.  
  602. switch(i)
  603. {
  604. case 0: { // 1
  605. message1 = CRcoverme
  606. }
  607. case 1: { // 2
  608. message1 = CRtakepoint
  609. }
  610. case 2: { // 3
  611. message1 = CRhposition
  612. }
  613. case 3: { // 4
  614. message1 = CRregroup
  615. }
  616. case 4: { // 5
  617. message1 = CRfollowme
  618. }
  619. case 5: { // 6
  620. message1 = CRfireassis
  621. }
  622. }
  623. client_print(players[a],print_chat,"%s (RADIO): %s",name, message1)
  624. g_RadioTimer[id] = 1
  625. set_task(2.0,"radiotimer",id)
  626. }
  627. return PLUGIN_HANDLED
  628. }
  629.  
  630. if(equal(komenda, cmd_radio2[i]))
  631. {
  632. if(is_user_alive(id) == 0 || ze_is_user_zombie(id))
  633. return PLUGIN_HANDLED
  634. if(g_RadioTimer[id] == 1)
  635. return PLUGIN_HANDLED
  636.  
  637. new players[32],total, team_name[10]
  638. get_user_team(id,team_name, 9)
  639. get_players(players, total ,"ce", team_name) // No bots and Match team name
  640. new name[32]
  641. get_user_name(id,name,31)
  642. for(new a=0; a < total; ++a)
  643. {
  644. client_cmd(players[a], "spk ^"%s^"", radio2_spk[i])
  645. if (get_cvar_num("amx_real_radio"))
  646. {
  647. emit_sound(id, CHAN_VOICE, radio2_spk[i] , 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
  648. }
  649. new message2[64]
  650.  
  651. switch(i)
  652. {
  653. case 0: { // 1
  654. message2 = CRgo
  655. }
  656. case 1: { // 2
  657. message2 = CRfallback
  658. }
  659. case 2: { // 3
  660. message2 = CRsticktog
  661. }
  662. case 3: { // 4
  663. message2 = CRgetinpos
  664. }
  665. case 4: { // 5
  666. message2 = CRstormfront
  667. }
  668. case 5: { // 6
  669. message2 = CRreportin
  670. }
  671. }
  672. client_print(players[a],print_chat,"%s (RADIO): %s",name, message2)
  673. g_RadioTimer[id] = 1
  674. set_task(2.0,"radiotimer",id)
  675. }
  676. return PLUGIN_HANDLED
  677. }
  678. }
  679.  
  680. for(new i = 0; i < 9; i++)
  681. {
  682. if(equal(komenda, cmd_radio3[i]))
  683. {
  684. if(is_user_alive(id) == 0 || ze_is_user_zombie(id))
  685. return PLUGIN_HANDLED
  686. if(g_RadioTimer[id] == 1)
  687. return PLUGIN_HANDLED
  688.  
  689. new players[32],total, team_name[10]
  690. get_user_team(id,team_name, 9)
  691. get_players(players, total ,"ce", team_name) // No bots and Match team name
  692. new name[32]
  693. get_user_name(id,name,31)
  694. for(new a=0; a < total; ++a)
  695. {
  696. client_cmd(players[a], "spk ^"%s^"", radio3_spk[i])
  697. if (get_cvar_num("amx_real_radio"))
  698. {
  699. emit_sound(id, CHAN_VOICE, radio3_spk[i] , 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
  700. }
  701. new message3[64]
  702.  
  703. switch(i)
  704. {
  705. case 0: { // 1
  706. message3 = CRroger
  707. }
  708. case 1: { // 2
  709. message3 = CRenemys
  710. }
  711. case 2: { // 3
  712. message3 = CRbackup
  713. }
  714. case 3: { // 4
  715. message3 = CRclear
  716. }
  717. case 4: { // 5
  718. message3 = CRposition
  719. }
  720. case 5: { // 6
  721. message3 = CRreportingin
  722. }
  723. case 6: { // 7
  724. message3 = CRgetoutblow
  725. }
  726. case 7: { // 8
  727. message3 = CRnegative
  728. }
  729. case 8: { // 9
  730. message3 = CRenemydown
  731. }
  732. }
  733. client_print(players[a],print_chat,"%s (RADIO): %s",name, message3)
  734. g_RadioTimer[id] = 1
  735. set_task(2.0,"radiotimer",id)
  736. }
  737. return PLUGIN_HANDLED
  738. }
  739. }
  740.  
  741. return PLUGIN_CONTINUE
  742. }
  743. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  744. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
  745. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement