HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4. #include <fakemeta_util>
  5. #include <hamsandwich>
  6. #include <cstrike>
  7. #include <fun>
  8. #include <zombieplague>
  9.  
  10. #define PLUGIN "Janus 1"
  11. #define VERSION "1.0"
  12. #define AUTHOR "m4m3ts"
  13.  
  14. #define CSW_JANUS1 CSW_FIVESEVEN
  15. #define weapon_janus1 "weapon_fiveseven"
  16. #define model_lama "models/w_fiveseven.mdl"
  17. #define RAHASIA 41546
  18.  
  19.  
  20. #define AMMO 5
  21. #define RELOAD_TIME 3.0
  22. #define TIME_STAB 1.5
  23. #define ATTACK_TIME 3.0
  24. #define SHOOT_TIME 0.5
  25. #define SHOOT_B_TIME 0.4
  26. #define DAMAGE 190.0
  27. #define NAMACLASSNYA "janus1"
  28.  
  29. const PDATA_SAFE = 2
  30. const OFFSET_LINUX_WEAPONS = 4
  31. const OFFSET_WEAPONOWNER = 41
  32. const m_flNextAttack = 83
  33. const m_szAnimExtention = 492
  34.  
  35. new const v_model[] = "models/v_janus1.mdl"
  36. new const p_model[] = "models/p_janus1.mdl"
  37. new const w_model[] = "models/w_janus1.mdl"
  38. new const GRENADE_MODEL[] = "models/grenade.mdl"
  39. new const GRENADE_EXPLOSION[] = "sprites/fexplo.spr"
  40. new cvar_dmg_janus1, cvar_ammo_janus1
  41.  
  42. new const weapon_sound[7][] =
  43. {
  44. "weapons/janus1-1.wav",
  45. "weapons/janus1-2.wav",
  46. "weapons/janus1_exp.wav",
  47. "weapons/janus1_draw.wav",
  48. "weapons/janus1_change1.wav",
  49. "weapons/janus1_change2.wav",
  50. "weapons/m79_draw.wav"
  51. }
  52.  
  53.  
  54. new const WeaponResource[4][] =
  55. {
  56. "sprites/weapon_janus1.txt",
  57. "sprites/640hud7.spr",
  58. "sprites/640hud12.spr",
  59. "sprites/640hud100.spr"
  60. }
  61.  
  62. enum
  63. {
  64. ANIM_IDLE = 0,
  65. ANIM_DRAW_NORMAL,
  66. ANIM_SHOOT_NORMAL,
  67. ANIM_SHOOT_ABIS,
  68. ANIM_SHOOT_SIGNAL,
  69. ANIM_CHANGE_1,
  70. ANIM_IDLE_B,
  71. ANIM_DRAW_B,
  72. ANIM_SHOOT_B,
  73. ANIM_SHOOT_B2,
  74. ANIM_CHANGE_2,
  75. ANIM_SIGNAL,
  76. ANIM_DRAW_SIGNAL,
  77. ANIM_SHOOT2_SIGNAL
  78. }
  79.  
  80. new sExplo
  81.  
  82. new g_had_janus1[33], g_janus_ammo[33], shoot_mode[33], hit_janus1[33], hit_on[33]
  83. new g_old_weapon[33]
  84. new sTrail, g_MaxPlayers, item_janus1
  85.  
  86. const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
  87.  
  88. public plugin_init()
  89. {
  90. register_plugin(PLUGIN, VERSION, AUTHOR)
  91. register_cvar("janus1_version", "m4m3ts", FCVAR_SERVER|FCVAR_SPONLY)
  92. register_forward(FM_CmdStart, "fw_CmdStart")
  93. register_forward(FM_SetModel, "fw_SetModel")
  94. register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
  95. register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
  96. register_think(NAMACLASSNYA, "fw_Think")
  97. register_touch(NAMACLASSNYA, "*", "fw_touch")
  98. RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
  99. RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  100. RegisterHam(Ham_Item_AddToPlayer, weapon_janus1, "fw_AddToPlayer_Post", 1)
  101. RegisterHam(Ham_Weapon_WeaponIdle, weapon_janus1, "fw_janusidleanim", 1)
  102. register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  103. g_MaxPlayers = get_maxplayers()
  104. register_clcmd("weapon_janus1", "hook_weapon")
  105.  
  106. item_janus1 = zp_register_extra_item("Janus-1", 14, ZP_TEAM_HUMAN)
  107.  
  108. cvar_dmg_janus1 = register_cvar("zp_janus1_dmg", "190.0")
  109. cvar_ammo_janus1 = register_cvar("zp_janus1_ammo", "5")
  110. }
  111.  
  112.  
  113. public plugin_precache()
  114. {
  115. precache_model(v_model)
  116. precache_model(p_model)
  117. precache_model(w_model)
  118. precache_model(GRENADE_MODEL)
  119. sExplo = precache_model(GRENADE_EXPLOSION)
  120.  
  121. for(new i = 0; i < sizeof(weapon_sound); i++)
  122. precache_sound(weapon_sound[i])
  123.  
  124. precache_generic(WeaponResource[0])
  125. for(new i = 1; i < sizeof(WeaponResource); i++)
  126. precache_model(WeaponResource[i])
  127.  
  128. sTrail = precache_model("sprites/laserbeam.spr")
  129. }
  130.  
  131. public zp_user_infected_post(id)
  132. {
  133. remove_janus(id)
  134. }
  135.  
  136. public Player_Spawn(id)
  137. {
  138. remove_janus(id)
  139. }
  140.  
  141. public fw_PlayerKilled(id)
  142. {
  143. remove_janus(id)
  144. }
  145.  
  146. public hook_weapon(id)
  147. {
  148. engclient_cmd(id, weapon_janus1)
  149. return
  150. }
  151.  
  152. public zp_extra_item_selected(id, itemid)
  153. {
  154. if(itemid == item_janus1) get_janus1(id)
  155. }
  156.  
  157. public get_janus1(id)
  158. {
  159. if(!is_user_alive(id))
  160. return
  161. drop_weapons(id, 1)
  162. g_had_janus1[id] = 1
  163. g_janus_ammo[id] = get_pcvar_num(cvar_ammo_janus1)
  164. shoot_mode[id] = 1
  165. hit_janus1[id] = 0
  166. hit_on[id] = 0
  167.  
  168. give_item(id, weapon_janus1)
  169. if(get_user_weapon(id) == CSW_JANUS1 && g_had_janus1[id]) peluru_hud(id)
  170.  
  171. static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_janus1, id)
  172. if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  173. }
  174.  
  175. public remove_janus(id)
  176. {
  177. g_had_janus1[id] = 0
  178. g_janus_ammo[id] = 0
  179. }
  180.  
  181. public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
  182. {
  183. if(!is_user_alive(id) || !is_user_connected(id))
  184. return FMRES_IGNORED
  185. if(get_user_weapon(id) == CSW_JANUS1 && g_had_janus1[id])
  186. set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001)
  187.  
  188. return FMRES_HANDLED
  189. }
  190.  
  191. public message_DeathMsg(msg_id, msg_dest, id)
  192. {
  193. static szTruncatedWeapon[33], iAttacker, iVictim
  194.  
  195. get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
  196.  
  197. iAttacker = get_msg_arg_int(1)
  198. iVictim = get_msg_arg_int(2)
  199.  
  200. if(!is_user_connected(iAttacker) || iAttacker == iVictim) return PLUGIN_CONTINUE
  201.  
  202. if(get_user_weapon(iAttacker) == CSW_JANUS1)
  203. {
  204. if(g_had_janus1[iAttacker])
  205. set_msg_arg_string(4, "grenade")
  206. }
  207.  
  208. return PLUGIN_CONTINUE
  209. }
  210.  
  211. public Event_CurWeapon(id)
  212. {
  213. if(!is_user_alive(id))
  214. return
  215.  
  216. if(get_user_weapon(id) == CSW_JANUS1 && g_had_janus1[id])
  217. {
  218. set_pev(id, pev_viewmodel2, v_model)
  219. set_pev(id, pev_weaponmodel2, p_model)
  220. if(shoot_mode[id] == 1) set_weapon_anim(id, ANIM_DRAW_NORMAL)
  221. if(shoot_mode[id] == 2) set_weapon_anim(id, ANIM_DRAW_SIGNAL)
  222. if(shoot_mode[id] == 3) set_weapon_anim(id, ANIM_DRAW_B)
  223. peluru_hud(id)
  224. }
  225.  
  226. g_old_weapon[id] = get_user_weapon(id)
  227. }
  228.  
  229. public fw_CmdStart(id, uc_handle, seed)
  230. {
  231. if(!is_user_alive(id) || !is_user_connected(id))
  232. return
  233. if(get_user_weapon(id) != CSW_JANUS1 || !g_had_janus1[id])
  234. return
  235.  
  236. static ent; ent = fm_get_user_weapon_entity(id, CSW_JANUS1)
  237. if(!pev_valid(ent))
  238. return
  239. if(get_pdata_float(ent, 46, OFFSET_LINUX_WEAPONS) > 0.0 || get_pdata_float(ent, 47, OFFSET_LINUX_WEAPONS) > 0.0)
  240. return
  241.  
  242. static CurButton
  243. CurButton = get_uc(uc_handle, UC_Buttons)
  244.  
  245. if(CurButton & IN_ATTACK)
  246. {
  247. CurButton &= ~IN_ATTACK
  248. set_uc(uc_handle, UC_Buttons, CurButton)
  249.  
  250. if(g_janus_ammo[id] == 1 && get_pdata_float(id, 83, 5) <= 0.0)
  251. {
  252. set_weapon_anim(id, ANIM_SHOOT_ABIS)
  253. emit_sound(id, CHAN_WEAPON, weapon_sound[1], 1.0, ATTN_NORM, 0, PITCH_NORM)
  254. g_janus_ammo[id]--
  255. Firejanus1(id)
  256. peluru_hud(id)
  257. set_weapons_timeidle(id, CSW_JANUS1, SHOOT_TIME)
  258. set_player_nextattackx(id, SHOOT_TIME)
  259. }
  260. if(g_janus_ammo[id] >= 2 && shoot_mode[id] == 1 && get_pdata_float(id, 83, 5) <= 0.0)
  261. {
  262. set_weapon_anim(id, ANIM_SHOOT_NORMAL)
  263. g_janus_ammo[id]--
  264. Firejanus1(id)
  265. peluru_hud(id)
  266. emit_sound(id, CHAN_WEAPON, weapon_sound[0], 1.0, ATTN_NORM, 0, PITCH_NORM)
  267. set_weapons_timeidle(id, CSW_JANUS1, ATTACK_TIME)
  268. set_player_nextattackx(id, ATTACK_TIME)
  269. }
  270. if(shoot_mode[id] == 3 && get_pdata_float(id, 83, 5) <= 0.0)
  271. {
  272. set_weapon_anim(id, ANIM_SHOOT_B2)
  273. Firejanus1(id)
  274. emit_sound(id, CHAN_WEAPON, weapon_sound[1], 1.0, ATTN_NORM, 0, PITCH_NORM)
  275. set_weapons_timeidle(id, CSW_JANUS1, SHOOT_B_TIME)
  276. set_player_nextattackx(id, SHOOT_B_TIME)
  277. }
  278. }
  279. else if(CurButton & IN_ATTACK2)
  280. {
  281. if(shoot_mode[id] == 2)
  282. {
  283. set_weapon_anim(id, ANIM_CHANGE_1)
  284. shoot_mode[id] = 3
  285. peluru_hud(id)
  286. set_task(8.5, "back_normal", id)
  287. set_task(8.5, "back_normal2", id)
  288. set_weapons_timeidle(id, CSW_JANUS1, TIME_STAB)
  289. set_player_nextattackx(id, TIME_STAB)
  290. }
  291. }
  292. }
  293.  
  294. public back_normal(id)
  295. {
  296. if(get_user_weapon(id) != CSW_JANUS1 || !g_had_janus1[id])
  297. return
  298.  
  299. set_weapon_anim(id, ANIM_CHANGE_2)
  300. emit_sound(id, CHAN_WEAPON, weapon_sound[5], 1.0, ATTN_NORM, 0, PITCH_NORM)
  301. set_weapons_timeidle(id, CSW_JANUS1, TIME_STAB)
  302. set_player_nextattackx(id, TIME_STAB)
  303. peluru_hud(id)
  304. }
  305.  
  306. public back_normal2(id)
  307. {
  308. shoot_mode[id] = 1
  309. hit_janus1[id] = 0
  310. }
  311.  
  312. public ready_transform(id)
  313. {
  314. shoot_mode[id] = 2
  315. set_weapons_timeidle(id, CSW_JANUS1, TIME_STAB)
  316. set_player_nextattackx(id, TIME_STAB)
  317. }
  318.  
  319. public fw_janusidleanim(Weapon)
  320. {
  321. new id = get_pdata_cbase(Weapon, 41, 4)
  322.  
  323. if(!is_user_alive(id) || zp_get_user_zombie(id) || !g_had_janus1[id] || get_user_weapon(id) != CSW_JANUS1)
  324. return HAM_IGNORED;
  325.  
  326. if(shoot_mode[id] == 1)
  327. return HAM_SUPERCEDE;
  328.  
  329. if(shoot_mode[id] == 3 && get_pdata_float(Weapon, 48, 4) <= 0.25)
  330. {
  331. set_weapon_anim(id, ANIM_IDLE_B)
  332. set_pdata_float(Weapon, 48, 20.0, 4)
  333. return HAM_SUPERCEDE;
  334. }
  335.  
  336. if(shoot_mode[id] == 2 && get_pdata_float(Weapon, 48, 4) <= 0.25)
  337. {
  338. set_weapon_anim(id, ANIM_SIGNAL)
  339. set_pdata_float(Weapon, 48, 20.0, 4)
  340. return HAM_SUPERCEDE;
  341. }
  342.  
  343. return HAM_IGNORED;
  344. }
  345.  
  346. public Firejanus1(id)
  347. {
  348. new Float:origin[3],Float:velocity[3],Float:angles[3]
  349. engfunc(EngFunc_GetAttachment, id, 0, origin,angles)
  350. pev(id,pev_angles,angles)
  351. new ent = create_entity( "info_target" )
  352. set_pev( ent, pev_classname, NAMACLASSNYA )
  353. set_pev( ent, pev_solid, SOLID_BBOX )
  354. set_pev( ent, pev_movetype, MOVETYPE_TOSS )
  355. set_pev( ent, pev_mins, { -0.1, -0.1, -0.1 } )
  356. set_pev( ent, pev_maxs, { 0.1, 0.1, 0.1 } )
  357. entity_set_model( ent, GRENADE_MODEL )
  358. set_pev( ent, pev_origin, origin )
  359. set_pev( ent, pev_angles, angles )
  360. set_pev( ent, pev_owner, id )
  361. velocity_by_aim( id, 1350, velocity )
  362. set_pev( ent, pev_velocity, velocity )
  363. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  364. write_byte(TE_BEAMFOLLOW) // Temporary entity ID
  365. write_short(ent) // Entity
  366. write_short(sTrail) // Sprite index
  367. write_byte(10) // Life
  368. write_byte(3) // Line width
  369. write_byte(255) // Red
  370. write_byte(255) // Green
  371. write_byte(255) // Blue
  372. write_byte(50) // Alpha
  373. message_end()
  374. return PLUGIN_CONTINUE
  375. }
  376.  
  377. public fw_Think_Plasma(ptr)
  378. {
  379. if(!pev_valid(ptr))
  380. return
  381.  
  382. static Float:RenderAmt; pev(ptr, pev_renderamt, RenderAmt)
  383.  
  384. RenderAmt += 50.0
  385. RenderAmt = float(clamp(floatround(RenderAmt), 0, 255))
  386.  
  387. set_pev(ptr, pev_renderamt, RenderAmt)
  388. set_pev(ptr, pev_nextthink, halflife_time() + 0.1)
  389. }
  390.  
  391. public fw_touch(ptr, ptd)
  392. {
  393. // If ent is valid
  394. if (pev_valid(ptr))
  395. {
  396. // Get it's origin
  397. new Float:originF[3]
  398. pev(ptr, pev_origin, originF)
  399. engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, originF, 0)
  400. write_byte(TE_WORLDDECAL)
  401. engfunc(EngFunc_WriteCoord, originF[0])
  402. engfunc(EngFunc_WriteCoord, originF[1])
  403. engfunc(EngFunc_WriteCoord, originF[2])
  404. write_byte(engfunc(EngFunc_DecalIndex,"{scorch3"))
  405. message_end()
  406. // Draw explosion
  407. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  408. write_byte(TE_EXPLOSION) // Temporary entity ID
  409. engfunc(EngFunc_WriteCoord, originF[0]) // engfunc because float
  410. engfunc(EngFunc_WriteCoord, originF[1])
  411. engfunc(EngFunc_WriteCoord, originF[2]+30.0)
  412. write_short(sExplo) // Sprite index
  413. write_byte(35) // Scale
  414. write_byte(35) // Framerate
  415. write_byte(0) // Flags
  416. message_end()
  417. emit_sound(ptr, CHAN_WEAPON, weapon_sound[2], 1.0, ATTN_NORM, 0, PITCH_NORM)
  418.  
  419. Damage_janus1(ptr, ptd)
  420.  
  421. engfunc(EngFunc_RemoveEntity, ptr)
  422. }
  423.  
  424. }
  425.  
  426. public Damage_janus1(ptr, ptd)
  427. {
  428. static Owner; Owner = pev(ptr, pev_owner)
  429. static Attacker
  430. if(!is_user_alive(Owner))
  431. {
  432. Attacker = 0
  433. return
  434. } else Attacker = Owner
  435.  
  436. for(new i = 0; i < g_MaxPlayers; i++)
  437. {
  438. if(!is_user_alive(i))
  439. continue
  440. if(entity_range(i, ptr) > 200.0)
  441. continue
  442. if(!zp_get_user_zombie(i))
  443. continue
  444.  
  445. ExecuteHamB(Ham_TakeDamage, i, 0, Attacker, get_pcvar_float(cvar_dmg_janus1), DMG_BULLET)
  446. hit_on[Attacker] = 1
  447. }
  448.  
  449. if(hit_on[Attacker] && hit_janus1[Attacker] < 6)
  450. {
  451. hit_janus1[Attacker] ++
  452. hit_on[Attacker] = 0
  453. }
  454.  
  455. if(hit_janus1[Attacker] == 5 && shoot_mode[Attacker] == 1) set_task(0.5, "ready_transform", Attacker)
  456. }
  457.  
  458. public fw_SetModel(entity, model[])
  459. {
  460. if(!pev_valid(entity))
  461. return FMRES_IGNORED
  462.  
  463. static Classname[64]
  464. pev(entity, pev_classname, Classname, sizeof(Classname))
  465.  
  466. if(!equal(Classname, "weaponbox"))
  467. return FMRES_IGNORED
  468.  
  469. static id
  470. id = pev(entity, pev_owner)
  471.  
  472. if(equal(model, model_lama))
  473. {
  474. static weapon
  475. weapon = fm_get_user_weapon_entity(entity, CSW_JANUS1)
  476.  
  477. if(!pev_valid(weapon))
  478. return FMRES_IGNORED
  479.  
  480. if(g_had_janus1[id])
  481. {
  482. set_pev(weapon, pev_impulse, RAHASIA)
  483. set_pev(weapon, pev_iuser4, g_janus_ammo[id])
  484. engfunc(EngFunc_SetModel, entity, w_model)
  485.  
  486. g_had_janus1[id] = 0
  487. g_janus_ammo[id] = 0
  488.  
  489. return FMRES_SUPERCEDE
  490. }
  491. }
  492.  
  493. return FMRES_IGNORED;
  494. }
  495.  
  496. public fw_AddToPlayer_Post(ent, id)
  497. {
  498. if(pev(ent, pev_impulse) == RAHASIA)
  499. {
  500. g_had_janus1[id] = 1
  501. g_janus_ammo[id] = pev(ent, pev_iuser4)
  502.  
  503. set_pev(ent, pev_impulse, 0)
  504. }
  505.  
  506. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
  507. write_string((g_had_janus1[id] == 1 ? "weapon_janus1" : "weapon_fiveseven"))
  508. write_byte(1)
  509. write_byte(100)
  510. write_byte(-1)
  511. write_byte(-1)
  512. write_byte(1)
  513. write_byte(6)
  514. write_byte(CSW_JANUS1)
  515. write_byte(0)
  516. message_end()
  517. }
  518.  
  519. public peluru_hud(id)
  520. {
  521. if(!is_user_alive(id))
  522. return
  523.  
  524. static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_janus1, id)
  525. if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  526.  
  527. cs_set_user_bpammo(id, CSW_FIVESEVEN, 0)
  528.  
  529. engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, get_user_msgid("CurWeapon"), {0, 0, 0}, id)
  530. write_byte(1)
  531. write_byte(CSW_JANUS1)
  532. write_byte(-1)
  533. message_end()
  534.  
  535. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("AmmoX"), _, id)
  536. write_byte(1)
  537. write_byte(g_janus_ammo[id])
  538. message_end()
  539. }
  540.  
  541. stock set_weapon_anim(id, anim)
  542. {
  543. if(!is_user_alive(id))
  544. return
  545.  
  546. set_pev(id, pev_weaponanim, anim)
  547.  
  548. message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id)
  549. write_byte(anim)
  550. write_byte(pev(id, pev_body))
  551. message_end()
  552. }
  553.  
  554. stock get_weapon_attachment(id, Float:output[3], Float:fDis = 40.0)
  555. {
  556. new Float:vfEnd[3], viEnd[3]
  557. get_user_origin(id, viEnd, 3)
  558. IVecFVec(viEnd, vfEnd)
  559.  
  560. new Float:fOrigin[3], Float:fAngle[3]
  561.  
  562. pev(id, pev_origin, fOrigin)
  563. pev(id, pev_view_ofs, fAngle)
  564.  
  565. xs_vec_add(fOrigin, fAngle, fOrigin)
  566.  
  567. new Float:fAttack[3]
  568.  
  569. xs_vec_sub(vfEnd, fOrigin, fAttack)
  570. xs_vec_sub(vfEnd, fOrigin, fAttack)
  571.  
  572. new Float:fRate
  573.  
  574. fRate = fDis / vector_length(fAttack)
  575. xs_vec_mul_scalar(fAttack, fRate, fAttack)
  576.  
  577. xs_vec_add(fOrigin, fAttack, output)
  578. }
  579.  
  580. stock drop_weapons(id, dropwhat)
  581. {
  582. static weapons[32], num, i, weaponid
  583. num = 0
  584. get_user_weapons(id, weapons, num)
  585.  
  586. for (i = 0; i < num; i++)
  587. {
  588. weaponid = weapons[i]
  589.  
  590. if (dropwhat == 1 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))
  591. {
  592. static wname[32]
  593. get_weaponname(weaponid, wname, sizeof wname - 1)
  594. engclient_cmd(id, "drop", wname)
  595. }
  596. }
  597. }
  598.  
  599. stock set_weapons_timeidle(id, WeaponId ,Float:TimeIdle)
  600. {
  601. if(!is_user_alive(id))
  602. return
  603.  
  604. static entwpn; entwpn = fm_get_user_weapon_entity(id, WeaponId)
  605. if(!pev_valid(entwpn))
  606. return
  607.  
  608. set_pdata_float(entwpn, 46, TimeIdle, OFFSET_LINUX_WEAPONS)
  609. set_pdata_float(entwpn, 47, TimeIdle, OFFSET_LINUX_WEAPONS)
  610. set_pdata_float(entwpn, 48, TimeIdle + 0.5, OFFSET_LINUX_WEAPONS)
  611. }
  612.  
  613. stock set_player_nextattackx(id, Float:nexttime)
  614. {
  615. if(!is_user_alive(id))
  616. return
  617.  
  618. set_pdata_float(id, m_flNextAttack, nexttime, 5)
  619. }
  620. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  621. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  622. */
  623.