HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*
  2. *
  3. * Plugin: JailBreak Shop
  4. * Autor: MaNuCs
  5. *
  6. * Credits: rubee
  7. * Gladius
  8. * capostrike93
  9. * apu
  10. */
  11.  
  12. #include <amxmodx>
  13. #include <amxmisc>
  14. #include <hamsandwich>
  15. #include <cstrike>
  16. #include <fakemeta>
  17. #include <fun>
  18.  
  19. #define is_valid_player(%1) (1 <= %1 <= 32)
  20.  
  21. /*============================================================
  22. Variables
  23. ============================================================*/
  24.  
  25. new
  26. OnOff,
  27. OnOff2,
  28. precio1,
  29. precio2,
  30. precio3,
  31. precio4,
  32. precio5,
  33. precio6,
  34. precio7,
  35. precioC1,
  36. precioC2,
  37. precioC3,
  38. precioC4,
  39. CTDefaultDano,
  40. TDefaultDano,
  41. PaloDano,
  42. HachaDano,
  43. MacheteDano,
  44. MotocierraDano,
  45. hTDefaultDano,
  46. hCTDefaultDano,
  47. hPaloDano,
  48. hHachaDano,
  49. hMacheteDano,
  50. Vida,
  51. Armor,
  52. glock1,
  53. glock2,
  54. help,
  55. g_killjp,
  56. g_killhsjp,
  57. g_startjp,
  58. g_maxjp,
  59. g_iMsgSayText,
  60. syncObj,
  61. Ronda[33],
  62. Speed[33],
  63. Speed2[33],
  64. TCuchillo[33],
  65. CTCuchillo[33],
  66. Destapador[33],
  67. Hacha[33],
  68. Machete[33],
  69. Motocierra[33],
  70. g_jbpacks[33],
  71. quitar[33],
  72. regalar[33],
  73. gidPlayer[33]
  74.  
  75.  
  76. /*============================================================
  77. Weapon Model's
  78. ============================================================*/
  79.  
  80.  
  81. new VIEW_MODELT[] = "models/jailbreak_shop/v_rabkez.mdl"
  82. new PLAYER_MODELT[] = "models/jailbreak_shop/p_rabkez.mdl"
  83.  
  84. new VIEW_MODELCT[] = "models/jailbreak_shop/v_sokkolo.mdl"
  85. new PLAYER_MODELCT[] = "models/jailbreak_shop/p_sokkolo.mdl"
  86.  
  87. new VIEW_Hacha[] = "models/jailbreak_shop/v_tortalapat.mdl"
  88. new PLAYER_Hacha[] = "models/jailbreak_shop/p_tortalapat.mdl"
  89.  
  90. new VIEW_Machete[] = "models/jailbreak_shop/v_fejsze.mdl"
  91. new PLAYER_Machete[] = "models/jailbreak_shop/p_fejsze.mdl"
  92.  
  93. new VIEW_Palo[] = "models/jailbreak_shop/v_wcpumpa.mdl"
  94. new PLAYER_Palo[] = "models/jailbreak_shop/p_wcpumpa.mdl"
  95.  
  96. new VIEW_Moto[] = "models/jailbreak_shop/v_lancfuresz.mdl"
  97. new PLAYER_Moto[] = "models/jailbreak_shop/p_lancfuresz.mdl"
  98.  
  99. new WORLD_MODEL[] = "models/w_knife.mdl"
  100. new OLDWORLD_MODEL[] = "models/w_knife.mdl"
  101.  
  102. /*============================================================
  103.   Shop Sounds!
  104. ============================================================*/
  105. new const Si[] = { "jailbreak_shop/Yes.wav" }
  106. new const No[] = { "jailbreak_shop/No.wav" }
  107.  
  108. /*============================================================
  109.   Weapon Sound's
  110. ============================================================*/
  111.  
  112. new const palo_deploy[] = { "weapons/knife_deploy1.wav" }
  113. new const palo_slash1[] = { "weapons/knife_slash1.wav" }
  114. new const palo_slash2[] = { "weapons/knife_slash2.wav" }
  115. new const palo_wall[] = { "jailbreak_shop/Palo/PHitWall.wav" }
  116. new const palo_hit1[] = { "jailbreak_shop/Palo/PHit1.wav" }
  117. new const palo_hit2[] = { "jailbreak_shop/Palo/PHit2.wav" }
  118. new const palo_hit3[] = { "jailbreak_shop/Palo/PHit3.wav" }
  119. new const palo_hit4[] = { "jailbreak_shop/Palo/PHit4.wav" }
  120. new const palo_stab[] = { "jailbreak_shop/Palo/PStab.wav" }
  121.  
  122. new const hacha_deploy[] = { "weapons/knife_deploy1.wav" }
  123. new const hacha_slash1[] = { "jailbreak_shop/Hacha/HSlash1.wav" }
  124. new const hacha_slash2[] = { "jailbreak_shop/Hacha/HSlash2.wav" }
  125. new const hacha_wall[] = { "jailbreak_shop/Hacha/HHitWall.wav" }
  126. new const hacha_hit1[] = { "jailbreak_shop/Hacha/HHit1.wav" }
  127. new const hacha_hit2[] = { "jailbreak_shop/Hacha/HHit2.wav" }
  128. new const hacha_hit3[] = { "jailbreak_shop/Hacha/HHit3.wav" }
  129. new const hacha_stab[] = { "jailbreak_shop/Hacha/HHit4.wav" }
  130.  
  131. new const machete_deploy[] = { "jailbreak_shop/Machete/MConvoca.wav" }
  132. new const machete_slash1[] = { "jailbreak_shop/Machete/MSlash1.wav" }
  133. new const machete_slash2[] = { "jailbreak_shop/Machete/MSlash2.wav" }
  134. new const machete_wall[] = { "jailbreak_shop/Machete/MHitWall.wav" }
  135. new const machete_hit1[] = { "jailbreak_shop/Machete/MHit1.wav" }
  136. new const machete_hit2[] = { "jailbreak_shop/Machete/MHit2.wav" }
  137. new const machete_hit3[] = { "jailbreak_shop/Machete/MHit3.wav" }
  138. new const machete_hit4[] = { "jailbreak_shop/Machete/MHit4.wav" }
  139. new const machete_stab[] = { "jailbreak_shop/Machete/MStab.wav" }
  140.  
  141. new const motocierra_deploy[] = { "jailbreak_shop/Moto/MTConvoca.wav", }
  142. new const motocierra_slash[] = { "jailbreak_shop/Moto/MTSlash.wav", }
  143. new const motocierra_wall[] = { "jailbreak_shop/Moto/MTHitWall.wav" }
  144. new const motocierra_hit1[] = { "jailbreak_shop/Moto/MTHit1.wav", }
  145. new const motocierra_hit2[] = { "jailbreak_shop/Moto/MTHit2.wav", }
  146. new const motocierra_stab[] = { "jailbreak_shop/Moto/MTStab.wav" }
  147.  
  148. new const t_deploy[] = { "jailbreak_shop/T/TConvoca.wav", }
  149. new const t_slash1[] = { "jailbreak_shop/T/Slash1.wav", }
  150. new const t_slash2[] = { "jailbreak_shop/T/Slash2.wav", }
  151. new const t_wall[] = { "jailbreak_shop/T/THitWall.wav" }
  152. new const t_hit1[] = { "jailbreak_shop/T/THit1.wav", }
  153. new const t_hit2[] = { "jailbreak_shop/T/THit2.wav", }
  154. new const t_hit3[] = { "jailbreak_shop/T/THit3.wav", }
  155. new const t_hit4[] = { "jailbreak_shop/T/THit4.wav", }
  156. new const t_stab[] = { "jailbreak_shop/T/TStab.wav" }
  157.  
  158. new const ct_deploy[] = { "jailbreak_shop/CT/CTConvoca.wav", }
  159. new const ct_slash1[] = { "jailbreak_shop/CT/Slash1.wav", }
  160. new const ct_slash2[] = { "jailbreak_shop/CT/Slash2.wav", }
  161. new const ct_wall[] = { "jailbreak_shop/CT/CTHitWall.wav" }
  162. new const ct_hit1[] = { "jailbreak_shop/CT/CTHit1.wav", }
  163. new const ct_hit2[] = { "jailbreak_shop/CT/CTHit2.wav", }
  164. new const ct_hit3[] = { "jailbreak_shop/CT/CTHit3.wav", }
  165. new const ct_hit4[] = { "jailbreak_shop/CT/CTHit4.wav", }
  166. new const ct_stab[] = { "jailbreak_shop/CT/CTStab.wav" }
  167.  
  168.  
  169. /*============================================================
  170. Config
  171. ============================================================*/
  172.  
  173. public plugin_init()
  174. {
  175.  
  176. register_plugin("[JB] Shop", "2.9", "[M]aNuC[s]_")
  177.  
  178. register_clcmd("say /bolt", "Tienda")
  179. register_clcmd("say !bolt", "Tienda")
  180. register_clcmd("say_team /bolt", "Tienda")
  181. register_clcmd("say_team !bolt", "Tienda")
  182.  
  183. register_clcmd("say /mg", "duel_menu", ADMIN_ALL)
  184. register_clcmd("say !mg", "duel_menu", ADMIN_ALL)
  185. register_clcmd("say_team /mg", "duel_menu", ADMIN_ALL)
  186. register_clcmd("say_team !mg", "duel_menu", ADMIN_ALL)
  187. register_clcmd("JailBreak Pontok", "player")
  188.  
  189. RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1)
  190. RegisterHam(Ham_TakeDamage, "player", "FwdTakeDamage", 0)
  191. RegisterHam(Ham_Killed, "player", "fw_player_killed")
  192.  
  193. register_event("CurWeapon", "Event_Change_Weapon", "be", "1=1")
  194.  
  195. register_forward(FM_SetModel, "fw_SetModel")
  196. register_forward(FM_EmitSound, "Fwd_EmitSound")
  197.  
  198. /*============================================================
  199. Cvar's
  200. ============================================================*/
  201. g_killjp = register_cvar("jb_killJP", "5");
  202. g_killhsjp = register_cvar("jb_bonushsJP", "2");
  203. g_startjp = register_cvar("jb_startJP", "10");
  204. g_maxjp = register_cvar("jb_maxgiveJP", "10000");
  205.  
  206. OnOff = register_cvar("jb_Shop", "1")//1(ON) 0(OFF)
  207. OnOff2 = register_cvar("jb_ShopKnifes", "1")//1(ON) 0(OFF)
  208. help = register_cvar("jb_help", "1")//1(ON) 0(OFF)
  209.  
  210. precio1 = register_cvar("jb_pFlash", "8")
  211. precio2 = register_cvar("jb_pHe", "11")
  212. precio3 = register_cvar("jb_pHEFL", "22")
  213. precio4 = register_cvar("jb_pWalk", "25")
  214. precio5 = register_cvar("jb_pFast", "28")
  215. precio6 = register_cvar("jb_pDrugs", "30")
  216. precio7 = register_cvar("jb_pGlock", "36")
  217.  
  218. precioC1 = register_cvar("jb_pKnife1", "5")
  219. precioC2 = register_cvar("jb_pKnife2", "20")
  220. precioC3 = register_cvar("jb_pKnife3", "25")
  221. precioC4 = register_cvar("jb_pKnife4", "36")
  222.  
  223. TDefaultDano = register_cvar("jb_dKnifeT", "20")
  224. CTDefaultDano = register_cvar("jb_dKnifeCT", "50")
  225. PaloDano = register_cvar("jb_dKnife1", "30")
  226. HachaDano = register_cvar("jb_dKnife2", "60")
  227. MacheteDano = register_cvar("jb_dKnife3", "80")
  228. MotocierraDano = register_cvar("jb_dKnife4", "200")
  229.  
  230. hTDefaultDano = register_cvar("jb_dHsKnifeT", "30")
  231. hCTDefaultDano = register_cvar("jb_dHsKnifeCT", "80")
  232. hPaloDano = register_cvar("jb_dhsKnife1", "45")
  233. hHachaDano = register_cvar("jb_dhsKnife2", "75")
  234. hMacheteDano = register_cvar("jb_dhsKnife3", "95")
  235.  
  236. Vida = register_cvar("jb_drLife", "200")
  237. Armor = register_cvar("jb_drArmor", "200")
  238.  
  239. glock1 = register_cvar("jb_gClip", "20")
  240. glock2 = register_cvar("jb_gAmmo", "0")
  241.  
  242. g_iMsgSayText = get_user_msgid("SayText")
  243. syncObj = CreateHudSyncObj()
  244.  
  245.  
  246. /*============================================================
  247. Multi Lengual!
  248. ============================================================*/
  249. register_dictionary("jbshop.txt")
  250. }
  251.  
  252. /*============================================================
  253. Precaches
  254. ============================================================*/
  255. public plugin_precache()
  256. {
  257. precache_sound(Si)
  258. precache_sound(No)
  259.  
  260. precache_sound(t_deploy)
  261. precache_sound(t_slash1)
  262. precache_sound(t_slash2)
  263. precache_sound(t_stab)
  264. precache_sound(t_wall)
  265. precache_sound(t_hit1)
  266. precache_sound(t_hit2)
  267. precache_sound(t_hit3)
  268. precache_sound(t_hit4)
  269.  
  270. precache_sound(ct_deploy)
  271. precache_sound(ct_slash1)
  272. precache_sound(ct_slash2)
  273. precache_sound(ct_stab)
  274. precache_sound(ct_wall)
  275. precache_sound(ct_hit1)
  276. precache_sound(ct_hit2)
  277. precache_sound(ct_hit3)
  278. precache_sound(ct_hit4)
  279.  
  280. precache_sound(palo_deploy)
  281. precache_sound(palo_slash1)
  282. precache_sound(palo_slash2)
  283. precache_sound(palo_stab)
  284. precache_sound(palo_wall)
  285. precache_sound(palo_hit1)
  286. precache_sound(palo_hit2)
  287. precache_sound(palo_hit3)
  288. precache_sound(palo_hit4)
  289.  
  290. precache_sound(machete_deploy)
  291. precache_sound(machete_slash1)
  292. precache_sound(machete_slash2)
  293. precache_sound(machete_stab)
  294. precache_sound(machete_wall)
  295. precache_sound(machete_hit1)
  296. precache_sound(machete_hit2)
  297. precache_sound(machete_hit3)
  298. precache_sound(machete_hit4)
  299.  
  300. precache_sound(hacha_deploy)
  301. precache_sound(hacha_slash1)
  302. precache_sound(hacha_slash2)
  303. precache_sound(hacha_stab)
  304. precache_sound(hacha_wall)
  305. precache_sound(hacha_hit1)
  306. precache_sound(hacha_hit2)
  307. precache_sound(hacha_hit3)
  308.  
  309. precache_sound(motocierra_deploy)
  310. precache_sound(motocierra_slash)
  311. precache_sound(motocierra_stab)
  312. precache_sound(motocierra_wall)
  313. precache_sound(motocierra_hit1)
  314. precache_sound(motocierra_hit2)
  315.  
  316.  
  317. precache_model(VIEW_MODELT)
  318. precache_model(PLAYER_MODELT)
  319. precache_model(VIEW_MODELCT)
  320. precache_model(PLAYER_MODELCT)
  321. precache_model(VIEW_Palo)
  322. precache_model(PLAYER_Palo)
  323. precache_model(VIEW_Hacha)
  324. precache_model(PLAYER_Hacha)
  325. precache_model(VIEW_Machete)
  326. precache_model(PLAYER_Machete)
  327. precache_model(VIEW_Moto)
  328. precache_model(PLAYER_Moto)
  329. precache_model(WORLD_MODEL)
  330.  
  331. return PLUGIN_CONTINUE
  332. }
  333.  
  334. /*============================================================
  335.   KNIFE SHOP
  336. ============================================================*/
  337. public Tienda1(id)
  338. {
  339. if(get_pcvar_num(OnOff2))
  340. {
  341. if (get_user_team(id) == 1 )
  342. {
  343. static Item[64]
  344.  
  345. formatex(Item, charsmax(Item),"\y%L", LANG_PLAYER, "SHOP")
  346. new Menu = menu_create(Item, "CuchilleroHandler")
  347.  
  348. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "KNIFE1", get_pcvar_num(precioC1))
  349. menu_additem(Menu, Item, "1")
  350.  
  351. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "KNIFE2", get_pcvar_num(precioC2))
  352. menu_additem(Menu, Item, "2")
  353.  
  354. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "KNIFE3", get_pcvar_num(precioC3))
  355. menu_additem(Menu, Item, "3")
  356.  
  357. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "KNIFE4", get_pcvar_num(precioC4))
  358. menu_additem(Menu, Item, "4")
  359.  
  360. menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
  361. menu_display(id, Menu)
  362. }
  363. }
  364. return PLUGIN_HANDLED
  365. }
  366.  
  367. public CuchilleroHandler(id, menu, item)
  368. {
  369. if( item == MENU_EXIT )
  370. {
  371. menu_destroy(menu);
  372. return PLUGIN_HANDLED;
  373. }
  374. new data[6], iName[64];
  375. new access, callback;
  376. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  377.  
  378. new vivo = is_user_alive(id)
  379. new Obtener1 = get_pcvar_num(precioC1)
  380. new Obtener2 = get_pcvar_num(precioC2)
  381. new Obtener3 = get_pcvar_num(precioC3)
  382. new Obtener4 = get_pcvar_num(precioC4)
  383.  
  384. new key = str_to_num(data);
  385.  
  386. switch(key)
  387. {
  388. case 1:
  389. {
  390. if (g_jbpacks[id]>= Obtener1 && vivo)
  391. {
  392. g_jbpacks[id] -= Obtener1
  393. CTCuchillo[id] = 0
  394. TCuchillo[id] = 0
  395. Destapador[id] = 1
  396. Hacha[id] = 0
  397. Machete[id] = 0
  398. Motocierra[id] = 0
  399.  
  400.  
  401. ham_strip_weapon(id, "weapon_knife")
  402. give_item(id, "weapon_knife")
  403.  
  404. ChatColor(id, "%L", LANG_PLAYER, "BUY_KNIFE1")
  405. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  406. }
  407. else
  408. {
  409. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  410. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  411. }
  412. }
  413.  
  414. case 2:
  415. {
  416. if (g_jbpacks[id] >= Obtener2 && vivo)
  417. {
  418.  
  419. g_jbpacks[id] -= Obtener2
  420. CTCuchillo[id] = 0
  421. TCuchillo[id] = 0
  422. Destapador[id] = 0
  423. Hacha[id] = 1
  424. Machete[id] = 0
  425. Motocierra[id] = 0
  426.  
  427. ham_strip_weapon(id, "weapon_knife")
  428. give_item(id, "weapon_knife")
  429.  
  430. ChatColor(id, "%L", LANG_PLAYER, "BUY_KNIFE2")
  431. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  432. }
  433. else
  434. {
  435. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  436. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  437. }
  438. }
  439.  
  440. case 3:
  441. {
  442. if (g_jbpacks[id] >= Obtener3 && vivo)
  443. {
  444.  
  445. g_jbpacks[id] -= Obtener3
  446. CTCuchillo[id] = 0
  447. TCuchillo[id] = 0
  448. Destapador[id] = 0
  449. Hacha[id] = 0
  450. Machete[id] = 1
  451. Motocierra[id] = 0
  452.  
  453. ham_strip_weapon(id, "weapon_knife")
  454. give_item(id, "weapon_knife")
  455.  
  456. ChatColor(id, "%L", LANG_PLAYER, "BUY_KNIFE3")
  457. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  458. }
  459. else
  460. {
  461. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  462. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  463. }
  464. }
  465.  
  466. case 4:
  467. {
  468. if (g_jbpacks[id] >= Obtener4 && vivo)
  469. {
  470.  
  471. g_jbpacks[id] -= Obtener4
  472. CTCuchillo[id] = 0
  473. TCuchillo[id] = 0
  474. Destapador[id] = 0
  475. Hacha[id] = 0
  476. Machete[id] = 0
  477. Motocierra[id] = 1
  478.  
  479.  
  480. ham_strip_weapon(id, "weapon_knife")
  481. give_item(id, "weapon_knife")
  482.  
  483. ChatColor(id, "%L", LANG_PLAYER, "BUY_KNIFE4")
  484. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  485. }
  486. else
  487. {
  488. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  489. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  490. }
  491. }
  492. }
  493. menu_destroy(menu);
  494. return PLUGIN_HANDLED;
  495. }
  496.  
  497. /*============================================================
  498.   ITEM'S MENU
  499. ============================================================*/
  500. public Tienda(id)
  501. {
  502. if(get_pcvar_num(OnOff))
  503. {
  504. if(get_pcvar_num(OnOff) && Ronda[id])
  505. {
  506. if(is_user_alive(id))
  507. {
  508. if (cs_get_user_team(id) == CS_TEAM_T )
  509. {
  510. new contador=0;
  511. new players[32], num, tempid;
  512.  
  513. get_players(players, num)
  514.  
  515. for (new i=0; i<num; i++)
  516. {
  517. tempid = players[i]
  518.  
  519. if (get_user_team(tempid)==1 && is_user_alive(tempid))
  520. {
  521. contador++;
  522. }
  523. }
  524. if ( contador == 1 )
  525. {
  526. ChatColor(id, "%L", LANG_PLAYER, "LAST")
  527. }
  528. else if ( contador >= 2 )
  529. {
  530. static Item[64]
  531.  
  532. formatex(Item, charsmax(Item),"\y%L", LANG_PLAYER, "SHOP")
  533. new Menu = menu_create(Item, "TiendaHandler")
  534.  
  535. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "FLASH", get_pcvar_num(precio1))
  536. menu_additem(Menu, Item, "1")
  537.  
  538. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "HE", get_pcvar_num(precio2))
  539. menu_additem(Menu, Item, "2")
  540.  
  541. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "HEFLASH", get_pcvar_num(precio3))
  542. menu_additem(Menu, Item, "3")
  543.  
  544. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "FOOTSTEPS", get_pcvar_num(precio4))
  545. menu_additem(Menu, Item, "4")
  546.  
  547. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "SPEED", get_pcvar_num(precio5))
  548. menu_additem(Menu, Item, "5")
  549.  
  550. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "DRUGS", get_pcvar_num(precio6))
  551. menu_additem(Menu, Item, "6")
  552.  
  553. formatex(Item, charsmax(Item),"\w%L \r%d$",LANG_PLAYER, "GLOCK", get_pcvar_num(precio7))
  554. menu_additem(Menu, Item, "7")
  555.  
  556. menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
  557. menu_display(id, Menu)
  558. }
  559. }
  560. else
  561. {
  562. ChatColor(id, "%L", LANG_PLAYER, "ONLY")
  563. }
  564. }
  565. else
  566. {
  567. ChatColor(id, "%L", LANG_PLAYER, "DEAD")
  568. }
  569. }
  570. else
  571. {
  572. ChatColor(id, "%L", LANG_PLAYER, "ONE_TIME")
  573. }
  574. }
  575. else
  576. {
  577. ChatColor(id, "%L", LANG_PLAYER, "SHOP_OFF")
  578. }
  579. return PLUGIN_HANDLED
  580. }
  581.  
  582.  
  583. public TiendaHandler(id, menu, item)
  584. {
  585. if( item == MENU_EXIT )
  586. {
  587. menu_destroy(menu);
  588. return PLUGIN_HANDLED;
  589. }
  590. new data[6], iName[64];
  591. new access, callback;
  592. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  593. new vivo = is_user_alive(id)
  594. new gmsg_SetFOV = get_user_msgid("SetFOV")
  595. new Obtener1 = get_pcvar_num(precio1)
  596. new Obtener2 = get_pcvar_num(precio2)
  597. new Obtener3 = get_pcvar_num(precio3)
  598. new Obtener4 = get_pcvar_num(precio4)
  599. new Obtener5 = get_pcvar_num(precio5)
  600. new Obtener6 = get_pcvar_num(precio6)
  601. new Obtener7 = get_pcvar_num(precio7)
  602. new vida1 = get_user_health(id)
  603. new vida2 = get_pcvar_num(Vida)
  604. new armor1 = get_user_armor(id)
  605. new armor2 = get_pcvar_num(Armor)
  606.  
  607. new key = str_to_num(data);
  608. switch(key)
  609. {
  610. case 1:
  611. {
  612. if (g_jbpacks[id] >= Obtener1 && vivo)
  613. {
  614. g_jbpacks[id] -= Obtener1
  615. ChatColor(id, "%L", LANG_PLAYER, "BUY_FLASH")
  616. give_item(id, "weapon_flashbang")
  617. give_item(id, "weapon_flashbang")
  618. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  619. Ronda[id] = 0
  620. }
  621. else
  622. {
  623. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  624. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  625. }
  626. }
  627. case 2:
  628. {
  629.  
  630. if (g_jbpacks[id] >= Obtener2 && vivo)
  631. {
  632. g_jbpacks[id] -= Obtener2
  633. ChatColor(id, "%L", LANG_PLAYER, "BUY_HE")
  634. give_item(id, "weapon_hegrenade")
  635. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  636. Ronda[id] = 0
  637. }
  638. else
  639. {
  640. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  641. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  642. }
  643. }
  644. case 3:
  645. {
  646.  
  647. if (g_jbpacks[id] >= Obtener3 && vivo)
  648. {
  649. g_jbpacks[id] -= Obtener3
  650. ChatColor(id, "%L", LANG_PLAYER, "BUY_HEFLASH")
  651. give_item(id, "weapon_hegrenade")
  652. give_item(id, "weapon_flashbang")
  653. give_item(id, "weapon_flashbang")
  654. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  655. Ronda[id] = 0
  656. }
  657. else
  658. {
  659. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  660. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  661. }
  662. }
  663. case 4:
  664. {
  665.  
  666. if (g_jbpacks[id] >= Obtener4 && vivo)
  667. {
  668. g_jbpacks[id] -= Obtener4
  669. ChatColor(id, "%L", LANG_PLAYER, "BUY_FOOTSTEPS")
  670. set_user_footsteps(id, 1)
  671. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  672. Ronda[id] = 0
  673. }
  674. else
  675. {
  676. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  677. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  678. }
  679. }
  680. case 5:
  681. {
  682. if (g_jbpacks[id] >= Obtener5 && vivo)
  683. {
  684. g_jbpacks[id] -= Obtener5
  685. ChatColor(id, "%L", LANG_PLAYER, "BUY_SPEED")
  686. set_user_maxspeed(id, 500.0)
  687. Speed[id] = 1
  688. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  689. Ronda[id] = 0
  690. }
  691. else
  692. {
  693. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  694. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  695. }
  696. }
  697. case 6:
  698. {
  699. if (g_jbpacks[id] >= Obtener6 && vivo)
  700. {
  701. g_jbpacks[id] -= Obtener6
  702. ChatColor(id, "%L", LANG_PLAYER, "BUY_DRUGS")
  703. set_user_armor(id, armor1 + armor2)
  704. set_user_health(id, vida1 + vida2)
  705. set_user_maxspeed(id, 380.0)
  706. Speed2[id] = 1
  707. message_begin( MSG_ONE, gmsg_SetFOV, { 0, 0, 0 }, id )
  708. write_byte( 180 )
  709. message_end( )
  710. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  711. Ronda[id] = 0
  712. }
  713. else
  714. {
  715. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  716. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  717. }
  718. }
  719. case 7:
  720. {
  721. if (g_jbpacks[id] >= Obtener7 && vivo)
  722. {
  723. g_jbpacks[id] -= Obtener7
  724. ChatColor(id, "%L", LANG_PLAYER, "BUY_GLOCK")
  725. cs_set_weapon_ammo( give_item( id, "weapon_glock18" ), get_pcvar_num(glock1))
  726. cs_set_user_bpammo(id, CSW_GLOCK18, get_pcvar_num(glock2))
  727. emit_sound(id, CHAN_AUTO, Si, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  728. Ronda[id] = 0
  729. }
  730. else
  731. {
  732. ChatColor(id, "%L", LANG_PLAYER, "MONEY")
  733. emit_sound(id, CHAN_AUTO, No, VOL_NORM, ATTN_NORM , 0, PITCH_NORM)
  734. }
  735. }
  736. }
  737. menu_destroy(menu);
  738. return PLUGIN_HANDLED;
  739. }
  740.  
  741. public client_putinserver(id)
  742. {
  743. g_jbpacks[id] = get_pcvar_num(g_startjp)
  744. set_task(1.0, "JailbreakPacks", id, _, _, "b")
  745. }
  746.  
  747. public JailbreakPacks(id)
  748. {
  749. set_hudmessage(142, 239, 39, 0.50, 0.90, 0, 6.0, 2.5)
  750. ShowSyncHudMsg(id, syncObj,"JBPacks: %i", g_jbpacks[id])
  751. }
  752.  
  753. public duel_menu(id)
  754. {
  755. if (!is_user_admin(id))
  756. {
  757. ChatColor(id, "%L", LANG_PLAYER, "CANT")
  758. return PLUGIN_HANDLED
  759. }
  760.  
  761. static opcion[64]
  762.  
  763. formatex(opcion, charsmax(opcion),"\y%L", LANG_PLAYER, "JBPACKS")
  764. new iMenu = menu_create(opcion, "menu")
  765.  
  766. formatex(opcion, charsmax(opcion),"\w%L", LANG_PLAYER, "GIVE_JBPACKS")
  767. menu_additem(iMenu, opcion, "1")
  768.  
  769. formatex(opcion, charsmax(opcion),"\w%L", LANG_PLAYER, "TAKE_JBPACKS")
  770. menu_additem(iMenu, opcion, "2")
  771.  
  772. menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
  773. menu_display(id, iMenu, 0)
  774.  
  775. return PLUGIN_HANDLED
  776. }
  777.  
  778. public menu(id, menu, item)
  779. {
  780.  
  781. if (item == MENU_EXIT)
  782. {
  783. menu_destroy(menu)
  784. return PLUGIN_HANDLED
  785. }
  786.  
  787. new Data[6], Name[64]
  788. new Access, Callback
  789.  
  790. menu_item_getinfo(menu, item, Access, Data,5, Name, 63, Callback)
  791.  
  792. new Key = str_to_num(Data)
  793.  
  794. switch (Key)
  795. {
  796. case 1:
  797. {
  798. regalar[id] = 1
  799. quitar[id] = 0
  800. escojer(id)
  801. }
  802. case 2:
  803. {
  804. quitar[id] = 1
  805. regalar[id] = 0
  806. escojer(id)
  807. }
  808. }
  809.  
  810. menu_destroy(menu)
  811. return PLUGIN_HANDLED
  812. }
  813.  
  814.  
  815. public escojer(id)
  816. {
  817. static opcion[64]
  818.  
  819. formatex(opcion, charsmax(opcion),"\y%L", LANG_PLAYER, "CHOOSE")
  820. new iMenu = menu_create(opcion, "choose")
  821.  
  822. new players[32], pnum, tempid
  823. new szName[32], szTempid[10]
  824.  
  825. get_players(players, pnum, "a")
  826.  
  827. for( new i; i<pnum; i++ )
  828. {
  829. tempid = players[i]
  830.  
  831. get_user_name(tempid, szName, 31)
  832. num_to_str(tempid, szTempid, 9)
  833.  
  834. formatex(opcion, charsmax(opcion), "\w%s \rJbPacks[%d]", szName, g_jbpacks[tempid])
  835. menu_additem(iMenu, opcion, szTempid, 0)
  836. }
  837.  
  838. menu_display(id, iMenu)
  839. return PLUGIN_HANDLED
  840. }
  841.  
  842. public choose(id, menu, item)
  843. {
  844. if( item == MENU_EXIT )
  845. {
  846. menu_destroy(menu)
  847. return PLUGIN_HANDLED
  848. }
  849.  
  850. new Data[6], Name[64]
  851. new Access, Callback
  852. menu_item_getinfo(menu, item, Access, Data,5, Name, 63, Callback)
  853.  
  854. new tempid = str_to_num(Data)
  855.  
  856. gidPlayer[id] = tempid
  857. client_cmd(id, "messagemode JbPacks")
  858.  
  859. menu_destroy(menu)
  860. return PLUGIN_HANDLED
  861. }
  862.  
  863. public player(id)
  864. {
  865. new say[300]
  866. read_args(say, charsmax(say))
  867.  
  868. remove_quotes(say)
  869.  
  870. if(!is_str_num(say) || equal(say, ""))
  871. return PLUGIN_HANDLED
  872.  
  873. jbpacks(id, say)
  874.  
  875. return PLUGIN_CONTINUE
  876. }
  877.  
  878. jbpacks(id, say[]) {
  879. new amount = str_to_num(say)
  880. new victim = gidPlayer[id]
  881.  
  882. new vname[32]
  883.  
  884. if(victim > 0)
  885. {
  886. get_user_name(victim, vname, 31)
  887.  
  888. if(regalar[id])
  889. {
  890. if(amount > get_pcvar_num(g_maxjp))
  891. {
  892. g_jbpacks[victim] = get_pcvar_num(g_maxjp)
  893. }
  894. else
  895. {
  896. g_jbpacks[victim] = g_jbpacks[victim] + amount
  897. }
  898. ChatColor(0, "%L", LANG_PLAYER, "GIVE_MSG", amount, vname)
  899. }
  900. if(quitar[id])
  901. {
  902. if(amount > g_jbpacks[victim])
  903. {
  904. g_jbpacks[victim] = 0
  905. ChatColor(0, "%L", LANG_PLAYER, "TAKE_ALL", vname)
  906. }
  907. else
  908. {
  909. g_jbpacks[victim] = g_jbpacks[victim] - amount
  910. ChatColor(0, "%L", LANG_PLAYER, "TAKE_MSG", amount, vname)
  911. }
  912.  
  913. }
  914. }
  915.  
  916. return PLUGIN_HANDLED
  917. }
  918.  
  919. public Fwd_PlayerSpawn_Post(id)
  920. {
  921. if (is_user_alive(id))
  922. {
  923. if(get_user_team(id) == 1) strip_user_weapons(id); give_item(id, "weapon_knife")
  924.  
  925. set_user_footsteps(id, 0)
  926. Speed[id] = 0
  927. Speed2[id] = 0
  928. Ronda[id] = 1
  929. CTCuchillo[id] = 1
  930. TCuchillo[id] = 1
  931. Destapador[id] = 0
  932. Hacha[id] = 0
  933. Machete[id] = 0
  934. Motocierra[id] = 0
  935. Tienda1(id)
  936. if(get_pcvar_num(help)) ChatColor(id, "%L", LANG_PLAYER, "HELP")
  937. }
  938. }
  939.  
  940. public FwdTakeDamage(victim, inflictor, attacker, Float:damage, damage_bits)
  941. {
  942.  
  943. if (is_valid_player(attacker) && get_user_weapon(attacker) == CSW_KNIFE)
  944. {
  945. switch(get_user_team(attacker))
  946. {
  947. case 1:
  948. {
  949. if(TCuchillo[attacker])
  950. {
  951.  
  952. SetHamParamFloat(4, get_pcvar_float(TDefaultDano))
  953.  
  954. if(get_pdata_int(victim, 75) == HIT_HEAD)
  955. {
  956. SetHamParamFloat(4, get_pcvar_float(hTDefaultDano))
  957. }
  958. }
  959.  
  960. if(Destapador[attacker])
  961. {
  962. SetHamParamFloat(4, get_pcvar_float(PaloDano))
  963.  
  964. if(get_pdata_int(victim, 75) == HIT_HEAD)
  965. {
  966. SetHamParamFloat(4, get_pcvar_float(hPaloDano))
  967. }
  968. }
  969.  
  970. if(Hacha[attacker])
  971. {
  972. SetHamParamFloat(4, get_pcvar_float(HachaDano))
  973.  
  974. if(get_pdata_int(victim, 75) == HIT_HEAD)
  975. {
  976. SetHamParamFloat(4, get_pcvar_float(hHachaDano))
  977. }
  978. }
  979.  
  980. if(Machete[attacker])
  981. {
  982. SetHamParamFloat(4, get_pcvar_float(MacheteDano))
  983.  
  984. if(get_pdata_int(victim, 75) == HIT_HEAD)
  985. {
  986. SetHamParamFloat(4, get_pcvar_float(hMacheteDano))
  987. }
  988. }
  989.  
  990. if(Motocierra[attacker])
  991. {
  992. SetHamParamFloat(4, get_pcvar_float(MotocierraDano))
  993. }
  994. }
  995. case 2:
  996. {
  997. if(CTCuchillo[attacker])
  998. {
  999. SetHamParamFloat(4, get_pcvar_float(CTDefaultDano))
  1000.  
  1001. if(get_pdata_int(victim, 75) == HIT_HEAD)
  1002. {
  1003. SetHamParamFloat(4, get_pcvar_float(hCTDefaultDano))
  1004. }
  1005. }
  1006. }
  1007. }
  1008. }
  1009. return HAM_HANDLED
  1010. }
  1011.  
  1012. public fw_player_killed(victim, attacker, shouldgib)
  1013. {
  1014. if(get_user_team(attacker) == 1)
  1015. {
  1016. g_jbpacks[attacker] += get_pcvar_num(g_killjp)
  1017.  
  1018. if(get_pdata_int(victim, 75) == HIT_HEAD)
  1019. {
  1020. g_jbpacks[attacker] += get_pcvar_num(g_killhsjp)
  1021. }
  1022. }
  1023. }
  1024.  
  1025.  
  1026. public Event_Change_Weapon(id)
  1027. {
  1028. new weaponID = read_data(2)
  1029.  
  1030. switch (get_user_team(id))
  1031. {
  1032. case 1:
  1033. {
  1034. if(Speed[id])
  1035. {
  1036. set_user_maxspeed(id, 500.0)
  1037. }
  1038.  
  1039. if(Speed2[id])
  1040. {
  1041. set_user_maxspeed(id, 380.0)
  1042. }
  1043.  
  1044. if(weaponID == CSW_KNIFE && get_pcvar_num(OnOff2))
  1045. {
  1046. if(TCuchillo[id])
  1047. {
  1048. set_pev(id, pev_viewmodel2, VIEW_MODELT)
  1049. set_pev(id, pev_weaponmodel2, PLAYER_MODELT)
  1050. }
  1051.  
  1052. if(Destapador[id])
  1053. {
  1054. set_pev(id, pev_viewmodel2, VIEW_Palo)
  1055. set_pev(id, pev_weaponmodel2, PLAYER_Palo)
  1056. }
  1057.  
  1058. if(Hacha[id])
  1059. {
  1060. set_pev(id, pev_viewmodel2, VIEW_Hacha)
  1061. set_pev(id, pev_weaponmodel2, PLAYER_Hacha)
  1062. }
  1063.  
  1064. if(Machete[id])
  1065. {
  1066. set_pev(id, pev_viewmodel2, VIEW_Machete)
  1067. set_pev(id, pev_weaponmodel2, PLAYER_Machete)
  1068. }
  1069.  
  1070. if(Motocierra[id])
  1071. {
  1072. set_pev(id, pev_viewmodel2, VIEW_Moto)
  1073. set_pev(id, pev_weaponmodel2, PLAYER_Moto)
  1074. }
  1075.  
  1076.  
  1077. }
  1078. }
  1079. case 2:
  1080. {
  1081. if(CTCuchillo[id] && weaponID == CSW_KNIFE)
  1082. {
  1083. set_pev(id, pev_viewmodel2, VIEW_MODELCT)
  1084. set_pev(id, pev_weaponmodel2, PLAYER_MODELCT)
  1085. }
  1086. }
  1087. }
  1088. return PLUGIN_CONTINUE
  1089. }
  1090.  
  1091. public fw_SetModel(entity, model[])
  1092. {
  1093. if(!pev_valid(entity))
  1094. return FMRES_IGNORED
  1095.  
  1096. if(!equali(model, OLDWORLD_MODEL))
  1097. return FMRES_IGNORED
  1098.  
  1099. new className[33]
  1100. pev(entity, pev_classname, className, 32)
  1101.  
  1102. if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
  1103. {
  1104. engfunc(EngFunc_SetModel, entity, WORLD_MODEL)
  1105. return FMRES_SUPERCEDE
  1106. }
  1107. return FMRES_IGNORED
  1108. }
  1109.  
  1110. public Fwd_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
  1111. {
  1112.  
  1113. if (!is_user_connected(id))
  1114. return FMRES_IGNORED;
  1115.  
  1116. if(CTCuchillo[id])
  1117. {
  1118. if(get_user_team(id) == 2)
  1119. {
  1120. if (equal(sample[8], "kni", 3))
  1121. {
  1122. if (equal(sample[14], "sla", 3))
  1123. {
  1124. switch (random_num(1, 2))
  1125. {
  1126. case 1: engfunc(EngFunc_EmitSound, id, channel, ct_slash1, volume, attn, flags, pitch)
  1127. case 2: engfunc(EngFunc_EmitSound, id, channel, ct_slash2, volume, attn, flags, pitch)
  1128. }
  1129.  
  1130. return FMRES_SUPERCEDE;
  1131. }
  1132. if(equal(sample,"weapons/knife_deploy1.wav"))
  1133. {
  1134. engfunc(EngFunc_EmitSound, id, channel, ct_deploy, volume, attn, flags, pitch)
  1135. return FMRES_SUPERCEDE;
  1136. }
  1137. if (equal(sample[14], "hit", 3))
  1138. {
  1139. if (sample[17] == 'w')
  1140. {
  1141. engfunc(EngFunc_EmitSound, id, channel, ct_wall, volume, attn, flags, pitch)
  1142. return FMRES_SUPERCEDE;
  1143. }
  1144. else
  1145. {
  1146. switch (random_num(1, 4))
  1147. {
  1148. case 1: engfunc(EngFunc_EmitSound, id, channel, ct_hit1, volume, attn, flags, pitch)
  1149. case 2: engfunc(EngFunc_EmitSound, id, channel, ct_hit2, volume, attn, flags, pitch)
  1150. case 3: engfunc(EngFunc_EmitSound, id, channel, ct_hit3, volume, attn, flags, pitch)
  1151. case 4: engfunc(EngFunc_EmitSound, id, channel, ct_hit4, volume, attn, flags, pitch)
  1152. }
  1153.  
  1154. return FMRES_SUPERCEDE;
  1155. }
  1156. }
  1157. if (equal(sample[14], "sta", 3))
  1158. {
  1159. engfunc(EngFunc_EmitSound, id, channel, ct_stab, volume, attn, flags, pitch)
  1160. return FMRES_SUPERCEDE;
  1161. }
  1162. }
  1163. }
  1164. }
  1165.  
  1166. if(TCuchillo[id])
  1167. {
  1168. if(get_user_team(id) == 1)
  1169. {
  1170. if (equal(sample[8], "kni", 3))
  1171. {
  1172. if (equal(sample[14], "sla", 3))
  1173. {
  1174. switch (random_num(1, 2))
  1175. {
  1176. case 1: engfunc(EngFunc_EmitSound, id, channel, t_slash1, volume, attn, flags, pitch)
  1177. case 2: engfunc(EngFunc_EmitSound, id, channel, t_slash2, volume, attn, flags, pitch)
  1178. }
  1179.  
  1180. return FMRES_SUPERCEDE;
  1181. }
  1182. if(equal(sample,"weapons/knife_deploy1.wav"))
  1183. {
  1184. engfunc(EngFunc_EmitSound, id, channel, t_deploy, volume, attn, flags, pitch)
  1185. return FMRES_SUPERCEDE;
  1186. }
  1187. if (equal(sample[14], "hit", 3))
  1188. {
  1189. if (sample[17] == 'w')
  1190. {
  1191. engfunc(EngFunc_EmitSound, id, channel, t_wall, volume, attn, flags, pitch)
  1192. return FMRES_SUPERCEDE;
  1193. }
  1194. else
  1195. {
  1196. switch (random_num(1, 4))
  1197. {
  1198. case 1: engfunc(EngFunc_EmitSound, id, channel, t_hit1, volume, attn, flags, pitch)
  1199. case 2: engfunc(EngFunc_EmitSound, id, channel, t_hit2, volume, attn, flags, pitch)
  1200. case 3: engfunc(EngFunc_EmitSound, id, channel, t_hit3, volume, attn, flags, pitch)
  1201. case 4: engfunc(EngFunc_EmitSound, id, channel, t_hit4, volume, attn, flags, pitch)
  1202. }
  1203.  
  1204. return FMRES_SUPERCEDE;
  1205. }
  1206. }
  1207. if (equal(sample[14], "sta", 3))
  1208. {
  1209. engfunc(EngFunc_EmitSound, id, channel, t_stab, volume, attn, flags, pitch)
  1210. return FMRES_SUPERCEDE;
  1211. }
  1212. }
  1213. }
  1214. }
  1215.  
  1216. if(Destapador[id])
  1217. {
  1218. if (equal(sample[8], "kni", 3))
  1219. {
  1220. if (equal(sample[14], "sla", 3))
  1221. {
  1222. switch (random_num(1, 2))
  1223. {
  1224. case 1: engfunc(EngFunc_EmitSound, id, channel, palo_slash1, volume, attn, flags, pitch)
  1225. case 2: engfunc(EngFunc_EmitSound, id, channel, palo_slash2, volume, attn, flags, pitch)
  1226.  
  1227. }
  1228.  
  1229. return FMRES_SUPERCEDE;
  1230. }
  1231. if(equal(sample,"weapons/knife_deploy1.wav"))
  1232. {
  1233. engfunc(EngFunc_EmitSound, id, channel, palo_deploy, volume, attn, flags, pitch)
  1234. return FMRES_SUPERCEDE;
  1235. }
  1236. if (equal(sample[14], "hit", 3))
  1237. {
  1238. if (sample[17] == 'w')
  1239. {
  1240. engfunc(EngFunc_EmitSound, id, channel, palo_wall, volume, attn, flags, pitch)
  1241. return FMRES_SUPERCEDE;
  1242. }
  1243. else
  1244. {
  1245. switch (random_num(1, 4))
  1246. {
  1247. case 1:engfunc(EngFunc_EmitSound, id, channel, palo_hit1, volume, attn, flags, pitch)
  1248. case 2:engfunc(EngFunc_EmitSound, id, channel, palo_hit2, volume, attn, flags, pitch)
  1249. case 3:engfunc(EngFunc_EmitSound, id, channel, palo_hit3, volume, attn, flags, pitch)
  1250. case 4:engfunc(EngFunc_EmitSound, id, channel, palo_hit4, volume, attn, flags, pitch)
  1251. }
  1252.  
  1253. return FMRES_SUPERCEDE;
  1254. }
  1255. }
  1256. if (equal(sample[14], "sta", 3))
  1257. {
  1258. engfunc(EngFunc_EmitSound, id, channel, palo_stab, volume, attn, flags, pitch)
  1259. return FMRES_SUPERCEDE;
  1260. }
  1261. }
  1262. }
  1263.  
  1264. if(Hacha[id])
  1265. {
  1266.  
  1267. if (equal(sample[8], "kni", 3))
  1268. {
  1269. if (equal(sample[14], "sla", 3))
  1270. {
  1271. switch (random_num(1, 2))
  1272. {
  1273. case 1: engfunc(EngFunc_EmitSound, id, channel, hacha_slash1, volume, attn, flags, pitch)
  1274. case 2: engfunc(EngFunc_EmitSound, id, channel, hacha_slash2, volume, attn, flags, pitch)
  1275. }
  1276.  
  1277. return FMRES_SUPERCEDE;
  1278. }
  1279. if(equal(sample,"weapons/knife_deploy1.wav"))
  1280. {
  1281. engfunc(EngFunc_EmitSound, id, channel, hacha_deploy, volume, attn, flags, pitch)
  1282. return FMRES_SUPERCEDE;
  1283. }
  1284. if (equal(sample[14], "hit", 3))
  1285. {
  1286. if (sample[17] == 'w')
  1287. {
  1288. engfunc(EngFunc_EmitSound, id, channel, hacha_wall, volume, attn, flags, pitch)
  1289. return FMRES_SUPERCEDE;
  1290. }
  1291. else
  1292. {
  1293. switch (random_num(1, 3))
  1294. {
  1295. case 1: engfunc(EngFunc_EmitSound, id, channel, hacha_hit1, volume, attn, flags, pitch)
  1296. case 2: engfunc(EngFunc_EmitSound, id, channel, hacha_hit2, volume, attn, flags, pitch)
  1297. case 3: engfunc(EngFunc_EmitSound, id, channel, hacha_hit3, volume, attn, flags, pitch)
  1298. }
  1299.  
  1300. return FMRES_SUPERCEDE;
  1301. }
  1302. }
  1303. if (equal(sample[14], "sta", 3))
  1304. {
  1305. engfunc(EngFunc_EmitSound, id, channel, hacha_stab, volume, attn, flags, pitch)
  1306. return FMRES_SUPERCEDE;
  1307. }
  1308. }
  1309. }
  1310.  
  1311. if(Machete[id])
  1312. {
  1313. if (equal(sample[8], "kni", 3))
  1314. {
  1315. if (equal(sample[14], "sla", 3))
  1316. {
  1317. switch (random_num(1, 2))
  1318. {
  1319. case 1: engfunc(EngFunc_EmitSound, id, channel, machete_slash1, volume, attn, flags, pitch)
  1320. case 2: engfunc(EngFunc_EmitSound, id, channel, machete_slash2, volume, attn, flags, pitch)
  1321. }
  1322. return FMRES_SUPERCEDE;
  1323. }
  1324. if(equal(sample,"weapons/knife_deploy1.wav"))
  1325. {
  1326. engfunc(EngFunc_EmitSound, id, channel, machete_deploy, volume, attn, flags, pitch)
  1327. return FMRES_SUPERCEDE;
  1328. }
  1329. if (equal(sample[14], "hit", 3))
  1330. {
  1331. if (sample[17] == 'w')
  1332. {
  1333. engfunc(EngFunc_EmitSound, id, channel, machete_wall, volume, attn, flags, pitch)
  1334. return FMRES_SUPERCEDE;
  1335. }
  1336. else // hit
  1337. {
  1338. switch (random_num(1, 4))
  1339. {
  1340. case 1: engfunc(EngFunc_EmitSound, id, channel, machete_hit1, volume, attn, flags, pitch)
  1341. case 2: engfunc(EngFunc_EmitSound, id, channel, machete_hit2, volume, attn, flags, pitch)
  1342. case 3: engfunc(EngFunc_EmitSound, id, channel, machete_hit3, volume, attn, flags, pitch)
  1343. case 4: engfunc(EngFunc_EmitSound, id, channel, machete_hit4, volume, attn, flags, pitch)
  1344. }
  1345. return FMRES_SUPERCEDE;
  1346. }
  1347. }
  1348. if (equal(sample[14], "sta", 3))
  1349. {
  1350. engfunc(EngFunc_EmitSound, id, channel, machete_stab, volume, attn, flags, pitch)
  1351. return FMRES_SUPERCEDE;
  1352. }
  1353. }
  1354. }
  1355.  
  1356. if(Motocierra[id])
  1357. {
  1358.  
  1359. if (equal(sample[8], "kni", 3))
  1360. {
  1361. if (equal(sample[14], "sla", 3))
  1362. {
  1363. engfunc(EngFunc_EmitSound, id, channel, motocierra_slash, volume, attn, flags, pitch)
  1364. return FMRES_SUPERCEDE;
  1365. }
  1366. if(equal(sample,"weapons/knife_deploy1.wav"))
  1367. {
  1368. engfunc(EngFunc_EmitSound, id, channel, motocierra_deploy, volume, attn, flags, pitch)
  1369. return FMRES_SUPERCEDE;
  1370. }
  1371. if (equal(sample[14], "hit", 3))
  1372. {
  1373. if (sample[17] == 'w')
  1374. {
  1375. engfunc(EngFunc_EmitSound, id, channel, motocierra_wall, volume, attn, flags, pitch)
  1376. return FMRES_SUPERCEDE;
  1377. }
  1378. else
  1379. {
  1380. switch (random_num(1, 2))
  1381. {
  1382. case 1: engfunc(EngFunc_EmitSound, id, channel, motocierra_hit1, volume, attn, flags, pitch)
  1383. case 2: engfunc(EngFunc_EmitSound, id, channel, motocierra_hit2, volume, attn, flags, pitch)
  1384.  
  1385. }
  1386. return FMRES_SUPERCEDE;
  1387. }
  1388. }
  1389. if (equal(sample[14], "sta", 3))
  1390. {
  1391. engfunc(EngFunc_EmitSound, id, channel, motocierra_stab, volume, attn, flags, pitch)
  1392. return FMRES_SUPERCEDE;
  1393. }
  1394. }
  1395. }
  1396. return FMRES_IGNORED;
  1397. }
  1398.  
  1399. /*============================================================
  1400.   Stocks!
  1401. ============================================================*/
  1402. stock ChatColor(const id, const input[], any:...)
  1403. {
  1404. new count = 1, players[32]
  1405. static msg[191]
  1406. vformat(msg, 190, input, 3)
  1407.  
  1408. replace_all(msg, 190, "!g", "^4") // Green Color
  1409. replace_all(msg, 190, "!y", "^1") // Default Color
  1410. replace_all(msg, 190, "!team", "^3") // Team Color
  1411.  
  1412.  
  1413. if (id) players[0] = id; else get_players(players, count, "ch")
  1414. {
  1415. for (new i = 0; i < count; i++)
  1416. {
  1417. if (is_user_connected(players[i]))
  1418. {
  1419. message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText, _, players[i])
  1420. write_byte(players[i]);
  1421. write_string(msg);
  1422. message_end();
  1423. }
  1424. }
  1425. }
  1426. }
  1427.  
  1428. stock ham_strip_weapon(id,weapon[])
  1429. {
  1430. if(!equal(weapon,"weapon_",7)) return 0;
  1431.  
  1432. new wId = get_weaponid(weapon);
  1433. if(!wId) return 0;
  1434.  
  1435. new wEnt;
  1436. while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
  1437. if(!wEnt) return 0;
  1438.  
  1439. if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
  1440.  
  1441. if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
  1442. ExecuteHamB(Ham_Item_Kill,wEnt);
  1443.  
  1444. set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
  1445.  
  1446. return 1;
  1447. }
  1448. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  1449. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
  1450. */
  1451.