HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*
  2. amxx nisal gl9 BloodyGame.ru
  3. By WEREWOLF
  4. */
  5.  
  6. #include <amxmodx>
  7. #include <engine>
  8. #include <fakemeta>
  9. #include <fun>
  10. #include <hamsandwich>
  11. #include <xs>
  12. #include <cstrike>
  13. #include <zombieplague>
  14.  
  15. enum
  16. {
  17. anim_idle,
  18. anim_reload,
  19. anim_draw,
  20. anim_shoot1,
  21. anim_shoot2,
  22. anim_shoot3
  23. }
  24.  
  25. #define ENG_NULLENT -1
  26. #define EV_INT_WEAPONKEY EV_INT_impulse
  27.  
  28. #define mg3_xmas_WEAPONKEY 700
  29.  
  30. #define MAX_PLAYERS 32
  31. const USE_STOPPED = 0
  32. const OFFSET_ACTIVE_ITEM = 373
  33. const OFFSET_WEAPONOWNER = 41
  34. const OFFSET_LINUX = 5
  35. const OFFSET_LINUX_WEAPONS = 4
  36. #define WEAP_LINUX_XTRA_OFF 4
  37. #define m_fKnown 44
  38. #define m_flNextPrimaryAttack 46
  39. #define m_flTimeWeaponIdle 48
  40. #define m_iClip 51
  41. #define m_fInReload 54
  42. #define PLAYER_LINUX_XTRA_OFF 5
  43. #define m_flNextAttack 83
  44.  
  45. #define mg3_xmas_RELOAD_TIME 5.0
  46.  
  47. const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_M249)|(1<<CSW_M249)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_M249)
  48. new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
  49. "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_m249",
  50. "weapon_m249", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
  51. "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
  52. "weapon_ak47", "weapon_knife", "weapon_m249" }
  53.  
  54. new const Sound_Fire[][] = { "weapons/mg3_xmas_shoot1.wav" }
  55. new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }
  56. new mg3_xmas_V_MODEL[64] = "models/v_mg3_xmas.mdl"
  57. new mg3_xmas_P_MODEL[64] = "models/p_mg3_xmas.mdl"
  58. new mg3_xmas_W_MODEL[64] = "models/w_mg3_xmas.mdl"
  59.  
  60. new cvar_dmg_mg3_xmas, cvar_recoil_mg3_xmas, g_itemid_mg3_xmas, cvar_spd_mg3_xmas, cvar_mg3_xmas_ammo, cvar_clip_mg3_xmas
  61.  
  62. new g_has_mg3_xmas[33], g_MaxPlayers, Float:cl_pushangle[MAX_PLAYERS + 1][3], m_iBlood[2], g_orig_event_m249, g_IsInPrimaryAttack, g_clip_ammo[33], g_mg3_xmas_TmpClip[33]
  63.  
  64. public plugin_init()
  65. {
  66. register_plugin("BloodyGame", "1.0", "werewolf")
  67. register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
  68. register_event("CurWeapon","CurrentWeapon","be","1=1")
  69. RegisterHam(Ham_Item_AddToPlayer, "weapon_m249", "fw_Aug_AddToPlayer")
  70. RegisterHam(Ham_Use, "func_tank", "fw_UseStationary_Post", 1)
  71. RegisterHam(Ham_Use, "func_tankmortar", "fw_UseStationary_Post", 1)
  72. RegisterHam(Ham_Use, "func_tankrocket", "fw_UseStationary_Post", 1)
  73. RegisterHam(Ham_Use, "func_tanklaser", "fw_UseStationary_Post", 1)
  74. for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
  75. if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "fw_Item_Deploy_Post", 1)
  76. RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_m249", "fw_Aug_PrimaryAttack")
  77. RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_m249", "fw_Aug_PrimaryAttack_Post", 1)
  78. RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
  79. RegisterHam(Ham_Item_PostFrame, "weapon_m249", "mg3_xmas__ItemPostFrame");
  80. RegisterHam(Ham_Weapon_Reload, "weapon_m249", "mg3_xmas__Reload");
  81. RegisterHam(Ham_Weapon_Reload, "weapon_m249", "mg3_xmas__Reload_Post", 1);
  82. register_forward(FM_SetModel, "fw_SetModel")
  83. register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
  84. register_forward(FM_PlaybackEvent, "fwPlaybackEvent")
  85.  
  86. cvar_dmg_mg3_xmas = register_cvar("mg3_xmas_damage", "3.0")
  87. cvar_recoil_mg3_xmas = register_cvar("mg3_xmas_recoil", "0.5")
  88. cvar_spd_mg3_xmas = register_cvar("mg3_xmas_speed", "0.70")
  89. cvar_clip_mg3_xmas = register_cvar("mg3_xmas_clip", "200")
  90. cvar_mg3_xmas_ammo = register_cvar("mg3_xmas_ammo", "150")
  91.  
  92. g_itemid_mg3_xmas = zp_register_extra_item("MG3_XMAS", 50, ZP_TEAM_HUMAN)
  93. g_MaxPlayers = get_maxplayers()
  94. }
  95.  
  96. public plugin_precache()
  97. {
  98. //precache_sound("mg3/mg3_xmas_shoot1.wav")
  99. precache_model(mg3_xmas_V_MODEL)
  100. precache_model(mg3_xmas_P_MODEL)
  101. precache_model(mg3_xmas_W_MODEL)
  102. for(new i = 0; i < sizeof Sound_Fire; i++)
  103. precache_sound(Sound_Fire[i])
  104. m_iBlood[0] = precache_model("sprites/blood.spr")
  105. m_iBlood[1] = precache_model("sprites/bloodspray.spr")
  106.  
  107. register_forward(FM_PrecacheEvent, "fwPrecacheEvent_Post", 1)
  108. }
  109.  
  110. public zp_user_humanized_post(id)
  111. {
  112. g_has_mg3_xmas[id] = false
  113. }
  114.  
  115. public fwPrecacheEvent_Post(type, const name[])
  116. {
  117. if (equal("events/m249.sc", name))
  118. {
  119. g_orig_event_m249 = get_orig_retval()
  120. return FMRES_HANDLED
  121. }
  122.  
  123. return FMRES_IGNORED
  124. }
  125.  
  126. public client_connect(id)
  127. {
  128. g_has_mg3_xmas[id] = false
  129. }
  130.  
  131. public client_disconnect(id)
  132. {
  133. g_has_mg3_xmas[id] = false
  134. }
  135.  
  136. public zp_user_infected_post(id)
  137. {
  138. if (zp_get_user_zombie(id))
  139. {
  140. g_has_mg3_xmas[id] = false
  141. }
  142. }
  143.  
  144. public fw_SetModel(entity, model[])
  145. {
  146. if(!is_valid_ent(entity))
  147. return FMRES_IGNORED;
  148.  
  149. static szClassName[33]
  150. entity_get_string(entity, EV_SZ_classname, szClassName, charsmax(szClassName))
  151.  
  152. if(!equal(szClassName, "weaponbox"))
  153. return FMRES_IGNORED;
  154.  
  155. static iOwner
  156.  
  157. iOwner = entity_get_edict(entity, EV_ENT_owner)
  158.  
  159. if(equal(model, "models/w_m249.mdl"))
  160. {
  161. static iStoredAugID
  162.  
  163. iStoredAugID = find_ent_by_owner(ENG_NULLENT, "weapon_m249", entity)
  164.  
  165. if(!is_valid_ent(iStoredAugID))
  166. return FMRES_IGNORED;
  167.  
  168. if(g_has_mg3_xmas[iOwner])
  169. {
  170. entity_set_int(iStoredAugID, EV_INT_WEAPONKEY, mg3_xmas_WEAPONKEY)
  171.  
  172. g_has_mg3_xmas[iOwner] = false
  173.  
  174. entity_set_model(entity, mg3_xmas_W_MODEL)
  175.  
  176. return FMRES_SUPERCEDE;
  177. }
  178. }
  179.  
  180. return FMRES_IGNORED;
  181. }
  182.  
  183. public zp_extra_item_selected(id, itemid)
  184. {
  185. if(itemid == g_itemid_mg3_xmas)
  186. {
  187. drop_weapons(id, 1);
  188. new iWep2 = give_item(id,"weapon_m249")
  189. if( iWep2 > 0 )
  190. {
  191. cs_set_weapon_ammo( iWep2, get_pcvar_num(cvar_clip_mg3_xmas) )
  192. cs_set_user_bpammo (id, CSW_M249, get_pcvar_num(cvar_mg3_xmas_ammo))
  193. }
  194. g_has_mg3_xmas[id] = true;
  195. }
  196. }
  197.  
  198. public fw_Aug_AddToPlayer(Aug, id)
  199. {
  200. if(!is_valid_ent(Aug) || !is_user_connected(id))
  201. return HAM_IGNORED;
  202.  
  203. if(entity_get_int(Aug, EV_INT_WEAPONKEY) == mg3_xmas_WEAPONKEY)
  204. {
  205. g_has_mg3_xmas[id] = true
  206.  
  207. entity_set_int(Aug, EV_INT_WEAPONKEY, 0)
  208.  
  209. return HAM_HANDLED;
  210. }
  211. return HAM_IGNORED;
  212. }
  213.  
  214. public fw_UseStationary_Post(entity, caller, activator, use_type)
  215. {
  216. if (use_type == USE_STOPPED && is_user_connected(caller))
  217. replace_weapon_models(caller, get_user_weapon(caller))
  218. }
  219.  
  220. public fw_Item_Deploy_Post(weapon_ent)
  221. {
  222. static owner
  223. owner = fm_cs_get_weapon_ent_owner(weapon_ent)
  224.  
  225. static weaponid
  226. weaponid = cs_get_weapon_id(weapon_ent)
  227.  
  228. replace_weapon_models(owner, weaponid)
  229. }
  230.  
  231. public CurrentWeapon(id)
  232. {
  233. replace_weapon_models(id, read_data(2))
  234.  
  235. if(read_data(2) != CSW_M249 || !g_has_mg3_xmas[id])
  236. return
  237.  
  238. static Float:iSpeed
  239. if(g_has_mg3_xmas[id])
  240. iSpeed = get_pcvar_float(cvar_spd_mg3_xmas)
  241.  
  242. static weapon[32],Ent
  243. get_weaponname(read_data(2),weapon,31)
  244. Ent = find_ent_by_owner(-1,weapon,id)
  245. if(Ent)
  246. {
  247. static Float:Delay, Float:M_Delay
  248. Delay = get_pdata_float( Ent, 46, 4) * iSpeed
  249. M_Delay = get_pdata_float( Ent, 47, 4) * iSpeed
  250. if (Delay > 0.0)
  251. {
  252. set_pdata_float(Ent, 46, Delay, 4)
  253. set_pdata_float(Ent, 47, M_Delay, 4)
  254. }
  255. }
  256. }
  257.  
  258. replace_weapon_models(id, weaponid)
  259. {
  260. switch (weaponid)
  261. {
  262. case CSW_M249:
  263. {
  264. if (zp_get_user_zombie(id) || zp_get_user_survivor(id))
  265. return;
  266.  
  267. if(g_has_mg3_xmas[id])
  268. {
  269. set_pev(id, pev_viewmodel2, mg3_xmas_V_MODEL)
  270. set_pev(id, pev_weaponmodel2, mg3_xmas_P_MODEL)
  271. }
  272. }
  273. }
  274. }
  275.  
  276. public fw_UpdateClientData_Post(Player, SendWeapons, CD_Handle)
  277. {
  278. if(!is_user_alive(Player) || (get_user_weapon(Player) != CSW_M249 || !g_has_mg3_xmas[Player]))
  279.  
  280. return FMRES_IGNORED
  281.  
  282. set_cd(CD_Handle, CD_flNextAttack, halflife_time () + 0.001)
  283. return FMRES_HANDLED
  284. }
  285.  
  286. public fw_Aug_PrimaryAttack(Weapon)
  287. {
  288. new Player = get_pdata_cbase(Weapon, 41, 5)
  289.  
  290. if (!g_has_mg3_xmas[Player])
  291. return;
  292.  
  293. g_IsInPrimaryAttack = 1
  294. pev(Player,pev_punchangle,cl_pushangle[Player])
  295.  
  296. g_clip_ammo[Player] = cs_get_weapon_ammo(Weapon)
  297. }
  298.  
  299. public fwPlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
  300. {
  301. if (eventid != g_orig_event_m249 || !g_IsInPrimaryAttack)
  302. return FMRES_IGNORED
  303. if (!(1 <= invoker <= g_MaxPlayers))
  304. return FMRES_IGNORED
  305.  
  306. playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
  307. return FMRES_SUPERCEDE
  308. }
  309.  
  310. public fw_Aug_PrimaryAttack_Post(Weapon)
  311. {
  312. g_IsInPrimaryAttack = 0
  313. new Player = get_pdata_cbase(Weapon, 41, 5)
  314.  
  315. if(g_has_mg3_xmas[Player])
  316. {
  317. new Float:push[3]
  318. pev(Player,pev_punchangle,push)
  319. xs_vec_sub(push,cl_pushangle[Player],push)
  320.  
  321. xs_vec_mul_scalar(push,get_pcvar_float(cvar_recoil_mg3_xmas),push)
  322. xs_vec_add(push,cl_pushangle[Player],push)
  323. set_pev(Player,pev_punchangle,push)
  324.  
  325. if (!g_clip_ammo[Player])
  326. return
  327.  
  328. emit_sound(Player, CHAN_WEAPON, Sound_Fire[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  329. UTIL_PlayWeaponAnimation(Player, anim_reload)
  330.  
  331. make_blood_and_bulletholes(Player)
  332. }
  333. }
  334.  
  335. public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
  336. {
  337. if (victim != attacker && is_user_connected(attacker))
  338. {
  339. if(get_user_weapon(attacker) == CSW_M249)
  340. {
  341. if(g_has_mg3_xmas[attacker])
  342. SetHamParamFloat(4, damage * get_pcvar_float(cvar_dmg_mg3_xmas))
  343. }
  344. }
  345. }
  346.  
  347. public message_DeathMsg(msg_id, msg_dest, id)
  348. {
  349. static szTruncatedWeapon[33], iAttacker, iVictim
  350.  
  351. get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
  352.  
  353. iAttacker = get_msg_arg_int(1)
  354. iVictim = get_msg_arg_int(2)
  355.  
  356. if(!is_user_connected(iAttacker) || iAttacker == iVictim)
  357. return PLUGIN_CONTINUE
  358.  
  359. if(equal(szTruncatedWeapon, "m249") && get_user_weapon(iAttacker) == CSW_M249)
  360. {
  361. if(g_has_mg3_xmas[iAttacker])
  362. set_msg_arg_string(4, "[mg3_xmas]")
  363. }
  364.  
  365. return PLUGIN_CONTINUE
  366. }
  367.  
  368. stock fm_cs_get_current_weapon_ent(id)
  369. {
  370. return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX);
  371. }
  372.  
  373. stock fm_cs_get_weapon_ent_owner(ent)
  374. {
  375. return get_pdata_cbase(ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS);
  376. }
  377.  
  378. stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
  379. {
  380. set_pev(Player, pev_weaponanim, Sequence)
  381.  
  382. message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
  383. write_byte(Sequence)
  384. write_byte(pev(Player, pev_body))
  385. message_end()
  386. }
  387.  
  388. stock make_blood_and_bulletholes(id)
  389. {
  390. new aimOrigin[3], target, body
  391. get_user_origin(id, aimOrigin, 3)
  392. get_user_aiming(id, target, body)
  393.  
  394. if(target > 0 && target <= g_MaxPlayers && zp_get_user_zombie(target))
  395. {
  396. new Float:fStart[3], Float:fEnd[3], Float:fRes[3], Float:fVel[3]
  397. pev(id, pev_origin, fStart)
  398.  
  399. velocity_by_aim(id, 64, fVel)
  400.  
  401. fStart[0] = float(aimOrigin[0])
  402. fStart[1] = float(aimOrigin[1])
  403. fStart[2] = float(aimOrigin[2])
  404. fEnd[0] = fStart[0]+fVel[0]
  405. fEnd[1] = fStart[1]+fVel[1]
  406. fEnd[2] = fStart[2]+fVel[2]
  407.  
  408. new res
  409. engfunc(EngFunc_TraceLine, fStart, fEnd, 0, target, res)
  410. get_tr2(res, TR_vecEndPos, fRes)
  411.  
  412. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  413. write_byte(TE_BLOODSPRITE)
  414. write_coord(floatround(fStart[0]))
  415. write_coord(floatround(fStart[1]))
  416. write_coord(floatround(fStart[2]))
  417. write_short( m_iBlood [ 1 ])
  418. write_short( m_iBlood [ 0 ] )
  419. write_byte(70)
  420. write_byte(random_num(1,2))
  421. message_end()
  422.  
  423.  
  424. }
  425. else if(!is_user_connected(target))
  426. {
  427. if(target)
  428. {
  429. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  430. write_byte(TE_DECAL)
  431. write_coord(aimOrigin[0])
  432. write_coord(aimOrigin[1])
  433. write_coord(aimOrigin[2])
  434. write_byte(GUNSHOT_DECALS[random_num ( 0, sizeof GUNSHOT_DECALS -1 ) ] )
  435. write_short(target)
  436. message_end()
  437. }
  438. else
  439. {
  440. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  441. write_byte(TE_WORLDDECAL)
  442. write_coord(aimOrigin[0])
  443. write_coord(aimOrigin[1])
  444. write_coord(aimOrigin[2])
  445. write_byte(GUNSHOT_DECALS[random_num ( 0, sizeof GUNSHOT_DECALS -1 ) ] )
  446. message_end()
  447. }
  448.  
  449. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  450. write_byte(TE_GUNSHOTDECAL)
  451. write_coord(aimOrigin[0])
  452. write_coord(aimOrigin[1])
  453. write_coord(aimOrigin[2])
  454. write_short(id)
  455. write_byte(GUNSHOT_DECALS[random_num ( 0, sizeof GUNSHOT_DECALS -1 ) ] )
  456. message_end()
  457. }
  458. }
  459.  
  460. public mg3_xmas__ItemPostFrame(weapon_entity)
  461. {
  462. new id = pev(weapon_entity, pev_owner)
  463. if (!is_user_connected(id))
  464. return HAM_IGNORED;
  465.  
  466. if (!g_has_mg3_xmas[id])
  467. return HAM_IGNORED;
  468.  
  469. static iClipExtra
  470.  
  471. if(g_has_mg3_xmas[id])
  472. iClipExtra = get_pcvar_num(cvar_clip_mg3_xmas)
  473.  
  474. new Float:flNextAttack = get_pdata_float(id, m_flNextAttack, PLAYER_LINUX_XTRA_OFF)
  475.  
  476. new iBpAmmo = cs_get_user_bpammo(id, CSW_M249);
  477. new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)
  478.  
  479. new fInReload = get_pdata_int(weapon_entity, m_fInReload, WEAP_LINUX_XTRA_OFF)
  480.  
  481. if( fInReload && flNextAttack <= 0.0 )
  482. {
  483. new j = min(iClipExtra - iClip, iBpAmmo)
  484.  
  485. set_pdata_int(weapon_entity, m_iClip, iClip + j, WEAP_LINUX_XTRA_OFF)
  486. cs_set_user_bpammo(id, CSW_M249, iBpAmmo-j);
  487.  
  488. set_pdata_int(weapon_entity, m_fInReload, 0, WEAP_LINUX_XTRA_OFF)
  489. fInReload = 0
  490. }
  491.  
  492. return HAM_IGNORED;
  493. }
  494.  
  495. public mg3_xmas__Reload(weapon_entity)
  496. {
  497. new id = pev(weapon_entity, pev_owner)
  498. if (!is_user_connected(id))
  499. return HAM_IGNORED;
  500.  
  501. if (!g_has_mg3_xmas[id])
  502. return HAM_IGNORED;
  503.  
  504. static iClipExtra
  505.  
  506. if(g_has_mg3_xmas[id])
  507. iClipExtra = get_pcvar_num(cvar_clip_mg3_xmas)
  508.  
  509. g_mg3_xmas_TmpClip[id] = -1;
  510.  
  511. new iBpAmmo = cs_get_user_bpammo(id, CSW_M249);
  512. new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)
  513.  
  514. if (iBpAmmo <= 0)
  515. return HAM_SUPERCEDE;
  516.  
  517. if (iClip >= iClipExtra)
  518. return HAM_SUPERCEDE;
  519.  
  520. g_mg3_xmas_TmpClip[id] = iClip;
  521.  
  522. return HAM_IGNORED;
  523. }
  524.  
  525. public mg3_xmas__Reload_Post(weapon_entity)
  526. {
  527. new id = pev(weapon_entity, pev_owner)
  528. if (!is_user_connected(id))
  529. return HAM_IGNORED;
  530.  
  531. if (!g_has_mg3_xmas[id])
  532. return HAM_IGNORED;
  533.  
  534. if (g_mg3_xmas_TmpClip[id] == -1)
  535. return HAM_IGNORED;
  536.  
  537. static Float:iReloadTime
  538. if(g_has_mg3_xmas[id])
  539. iReloadTime = mg3_xmas_RELOAD_TIME
  540.  
  541. set_pdata_int(weapon_entity, m_iClip, g_mg3_xmas_TmpClip[id], WEAP_LINUX_XTRA_OFF)
  542.  
  543. set_pdata_float(weapon_entity, m_flTimeWeaponIdle, iReloadTime, WEAP_LINUX_XTRA_OFF)
  544.  
  545. set_pdata_float(id, m_flNextAttack, iReloadTime, PLAYER_LINUX_XTRA_OFF)
  546.  
  547. set_pdata_int(weapon_entity, m_fInReload, 1, WEAP_LINUX_XTRA_OFF)
  548.  
  549. UTIL_PlayWeaponAnimation(id, 3)
  550.  
  551. return HAM_IGNORED;
  552. }
  553.  
  554. stock drop_weapons(id, dropwhat)
  555. {
  556. static weapons[32], num, i, weaponid
  557. num = 0
  558. get_user_weapons(id, weapons, num)
  559.  
  560. for (i = 0; i < num; i++)
  561. {
  562. weaponid = weapons[i]
  563.  
  564. if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
  565. {
  566. static wname[32]
  567. get_weaponname(weaponid, wname, sizeof wname - 1)
  568. engclient_cmd(id, "drop", wname)
  569. }
  570. }
  571. }