Converted Dual Infinity

Zombies/Humans Extra-Items
Post Reply
User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 6 years ago
Contact:

Dual Infinity

#1

Post by SexY DeviL CJ » 5 years ago

Description:
The weapon features automatic (cross-handed) and semi-automatic (manual straight) shooting. This Was Officialy Made For CSO Then Converted For ZP And Finally Converted For Our Mod NOTE: This Plugin Is Not Made By Me Its Just Converted For Our Mod


Team:
Humans :)


Installations & Instructions:

Simple Like Other Plugins :D

Screenshots:

ImageImage


Downloads:
[ZE] Extra İtem Dual Infinity.rar
(1.14 MiB) Downloaded 702 times
[ZE] Extra İtem Dual Infinity.rar
(1.14 MiB) Downloaded 702 times
......Devil Was Here......

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#2

Post by Mark » 5 years ago

SexY DeviL CJ wrote: 5 years ago Description:
The weapon features automatic (cross-handed) and semi-automatic (manual straight) shooting. This Was Officialy Made For CSO Then Converted For ZP And Finally Converted For Our Mod NOTE: This Plugin Is Not Made By Me Its Just Converted For Our Mod


Team:
Humans :)


Installations & Instructions:

Simple Like Other Plugins :D

Screenshots:

ImageImage


Downloads:
[ZE] Extra İtem Dual Infinity.rar
Would be great if you kept the file structure of the Models/Sounds/sprites.

Fixed below but how can we stop secondary attack on freeze time.
  1. #include <zombie_escape>
  2. #include <cstrike>
  3. #include <fakemeta_util>
  4.  
  5.  
  6. #define PLUGIN "[ZE] Extra : DualInfinity"
  7. #define VERSION "1.0"
  8. #define AUTHOR "SexY Devil CJ"
  9.  
  10. #define CONFIG_CFG_FILE "weapons/dual_infinity.cfg"
  11.  
  12. #define OFFSET_LINUX_WEAPONS 4
  13. #define OFFSET_LINUX 5
  14.  
  15. #define m_flNextAttack  83
  16. #define m_flNextPrimaryAttack   46
  17. #define m_flTimeWeaponIdle  48
  18. #define m_fInReload     54
  19.  
  20. #define pev_weaponkey pev_impulse
  21. #define weaponkey_value 18318
  22.  
  23. #define CSW_INFINITY CSW_ELITE
  24.  
  25. new const g_weapon_entity[]="weapon_elite"
  26. new const g_weapon_event1[]="events/elite_right.sc"
  27. new const g_weapon_event2[]="events/elite_left.sc"
  28. new const g_weapon_weaponbox_model[]="models/w_elite.mdl"
  29.  
  30. new const weapon_list_txt[]="weapon_dual_infinity2"
  31.  
  32. new const weapon_list_sprites[][]=
  33. {  
  34.     "sprites/arwel/640hud42.spr",
  35.     "sprites/arwel/640hud43.spr",
  36.     "sprites/arwel/640hud7.spr"
  37. }
  38.  
  39. new const ViewModel[]="models/arwel/v_infinityex2.mdl"
  40. new const PlayerModel[]="models/arwel/p_infinity.mdl"
  41. new const WorldModel[]="models/arwel/w_infinity.mdl"
  42.  
  43. new const Sounds[][]=
  44. {
  45.     "weapons/infi-1.wav",
  46.     "weapons/infi_clipin.wav",
  47.     "weapons/infi_clipon.wav",
  48.     "weapons/infi_clipout.wav",
  49.     "weapons/infi_draw.wav"
  50. }
  51.  
  52. new Blood[2]
  53.  
  54. new g_orig_event_dinfinity
  55.  
  56. new g_HasInfinity[33], g_player_weapon_ammo[33], Float:cl_pushangle[33][3],  g_shoot_anim[33], g_hitgroup[33]
  57. new g_mode[33], g_anim_mode[33]
  58.  
  59. new g_itemid
  60.  
  61. new pcvar_clipammo, pcvar_bpammo, pcvar_time_fire_normal, pcvar_time_fire_fast
  62.  
  63. new pcvar_normal_damage_head, pcvar_normal_damage_chest, pcvar_normal_damage_stomach, pcvar_normal_damage_arms, pcvar_normal_damage_legs
  64. new pcvar_fast_damage_head, pcvar_fast_damage_chest, pcvar_fast_damage_stomach, pcvar_fast_damage_arms, pcvar_fast_damage_legs
  65.  
  66. new Float:cvar_time_fire_normal, Float:cvar_time_fire_fast
  67.  
  68. const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
  69.  
  70. public plugin_init()
  71. {  
  72.     register_plugin(PLUGIN, VERSION, AUTHOR)
  73.    
  74.     register_clcmd(weapon_list_txt, "Redirect")
  75.    
  76.     pcvar_bpammo=register_cvar("dinfinity_bpammo", "100")
  77.     pcvar_clipammo=register_cvar("dinfinity_clipammo", "40")
  78.     pcvar_time_fire_normal=register_cvar("dinfinity_fire_normal_period", "0.15")
  79.     pcvar_time_fire_fast=register_cvar("dinfinity_fire_fast_period", "0.02")
  80.    
  81.     pcvar_normal_damage_head=register_cvar("dinfinity_normal_damage_head", "130")
  82.     pcvar_normal_damage_chest=register_cvar("dinfinity_normal_damage_chest", "34")
  83.     pcvar_normal_damage_stomach=register_cvar("dinfinity_normal_damage_stomach", "34")
  84.     pcvar_normal_damage_arms=register_cvar("dinfinity_normal_damage_arms", "34")
  85.     pcvar_normal_damage_legs=register_cvar("dinfinity_normal_damage_legs", "34")
  86.    
  87.     pcvar_fast_damage_head=register_cvar("dinfinity_fast_damage_head", "115")
  88.     pcvar_fast_damage_chest=register_cvar("dinfinity_fast_damage_chest", "30")
  89.     pcvar_fast_damage_stomach=register_cvar("dinfinity_fast_damage_stomach", "30")
  90.     pcvar_fast_damage_arms=register_cvar("dinfinity_fast_damage_arms", "30")
  91.     pcvar_fast_damage_legs=register_cvar("dinfinity_fast_damage_legs", "30")   
  92.    
  93.     ReadSettings()
  94.    
  95.     RegisterHam(Ham_Item_AddToPlayer, g_weapon_entity, "fwAddToPlayer", 1)
  96.     RegisterHam(Ham_Item_Deploy, g_weapon_entity, "fwDeployPost", 1)
  97.     RegisterHam(Ham_Weapon_PrimaryAttack, g_weapon_entity, "fwPrimaryAttack")
  98.     RegisterHam(Ham_Weapon_Reload, g_weapon_entity, "fwReloadPre")
  99.     RegisterHam(Ham_Item_PostFrame, g_weapon_entity, "fwItemPostFrame")
  100.     RegisterHam(Ham_TakeDamage, "player", "fwDamagePre")
  101.     RegisterHam(Ham_RemovePlayerItem, "player", "fwRemoveItem")
  102.    
  103.     RegisterHam(Ham_TraceAttack, "player", "fwTraceAttackPost", 1)
  104.     RegisterHam(Ham_TraceAttack, "worldspawn", "fwTraceAttackPost", 1)
  105.     RegisterHam(Ham_TraceAttack, "func_breakable", "fwTraceAttackPost", 1)
  106.     RegisterHam(Ham_TraceAttack, "func_wall", "fwTraceAttackPost", 1)
  107.     RegisterHam(Ham_TraceAttack, "func_door", "fwTraceAttackPost", 1)
  108.     RegisterHam(Ham_TraceAttack, "func_door_rotating", "fwTraceAttackPost", 1)
  109.     RegisterHam(Ham_TraceAttack, "func_plat", "fwTraceAttackPost", 1)
  110.     RegisterHam(Ham_TraceAttack, "func_rotating", "fwTraceAttackPost", 1)  
  111.    
  112.     register_forward(FM_PlaybackEvent, "fwPlaybackEvent")  
  113.     register_forward(FM_UpdateClientData, "fwUpdateClientDataPost", 1)
  114.     register_forward(FM_CmdStart,  "fwCmdStart")
  115.     register_forward(FM_SetModel, "fwSetModel")
  116.    
  117.    
  118.     g_itemid = ze_register_item("Dual Infinity", 15, 0)
  119. }
  120.  
  121. public plugin_precache()
  122. {
  123.     precache_model(ViewModel)
  124.     precache_model(PlayerModel)
  125.     precache_model(WorldModel)
  126.    
  127.     for(new i; i<=charsmax(Sounds); i++)
  128.     {
  129.         precache_sound(Sounds[i])
  130.     }
  131.    
  132.     Blood[0] = precache_model("sprites/bloodspray.spr")
  133.     Blood[1] = precache_model("sprites/blood.spr") 
  134.    
  135.     new tmp[128]
  136.    
  137.     formatex(tmp, charsmax(tmp), "sprites/%s.txt", weapon_list_txt)
  138.    
  139.     precache_generic(tmp)
  140.    
  141.     for(new i; i<=charsmax(weapon_list_sprites); i++)
  142.     {
  143.         precache_generic(weapon_list_sprites[i])
  144.        
  145.     }
  146.    
  147.     register_forward(FM_PrecacheEvent, "fwPrecachePost", 1)
  148. }
  149.  
  150. public ReadSettings()
  151. {
  152.     new confdir[64], path[128]
  153.    
  154.     get_configsdir(confdir, charsmax(confdir))
  155.    
  156.     formatex(path, charsmax(path), "%s/%s", confdir, CONFIG_CFG_FILE)
  157.    
  158.     server_cmd("exec %s", path)
  159.     server_exec()
  160.    
  161.     cvar_time_fire_normal=get_pcvar_float(pcvar_time_fire_normal)/*ز �鳼 諳*/
  162.     cvar_time_fire_fast=get_pcvar_float(pcvar_time_fire_fast)
  163.    
  164. }
  165.  
  166. public ze_select_item_pre(id, itemid)
  167. {
  168.     // Return Available and we will block it in Post, So it dosen't affect other plugins
  169.     if (itemid != g_itemid)
  170.         return ZE_ITEM_AVAILABLE
  171.    
  172.     // Available for Humans only, So don't show it for zombies
  173.     if (ze_is_user_zombie(id))
  174.         return ZE_ITEM_DONT_SHOW
  175.    
  176.     return ZE_ITEM_AVAILABLE
  177. }
  178.  
  179.  
  180. public Redirect(id)
  181. {  
  182.     client_cmd(id, g_weapon_entity)
  183. }
  184.  
  185. public ze_select_item_post(id,  itemid)
  186. {
  187.     if(itemid!=g_itemid)
  188.         return
  189.    
  190.     give_infinity(id)  
  191. }
  192.  
  193. public client_disconnected(id)
  194. {
  195.     g_HasInfinity[id]=false
  196. }
  197.  
  198. public ze_user_infected(id, iInfector)
  199. {  
  200.     g_HasInfinity[id]=false
  201. }
  202.  
  203. public give_infinity(id)
  204. {
  205.     drop_weapons(id, 2)
  206.    
  207.     g_HasInfinity[id]=true
  208.    
  209.     new ent=fm_give_item(id, g_weapon_entity)
  210.    
  211.     cs_set_user_bpammo(id, CSW_INFINITY, get_pcvar_num(pcvar_bpammo))
  212.     cs_set_weapon_ammo(ent, get_pcvar_num(pcvar_clipammo))
  213.  
  214.    
  215.     InfinitySprite(id) 
  216. }
  217.  
  218. public fwPrecachePost(type, const name[])
  219. {
  220.     if (equal(g_weapon_event1, name) || equal(g_weapon_event2, name) )
  221.     {
  222.         g_orig_event_dinfinity=get_orig_retval()
  223.        
  224.         return FMRES_HANDLED
  225.     }
  226.    
  227.     return FMRES_IGNORED
  228. }
  229.  
  230. public fwPlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
  231. {
  232.     if ((eventid != g_orig_event_dinfinity))
  233.         return FMRES_IGNORED
  234.    
  235.     if (!is_valid_player(invoker))
  236.         return FMRES_IGNORED
  237.    
  238.     fm_playback_event(flags|FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
  239.    
  240.     return FMRES_SUPERCEDE
  241. }
  242.  
  243. public fwUpdateClientDataPost(id, SendWeapons, CD_Handle)
  244. {
  245.     if (!is_valid_player(id))
  246.         return FMRES_IGNORED
  247.    
  248.     if(get_user_weapon(id)!=CSW_INFINITY)
  249.         return FMRES_IGNORED
  250.    
  251.    
  252.     set_cd(CD_Handle, CD_flNextAttack, get_gametime() + 0.001)
  253.    
  254.     return FMRES_HANDLED
  255. }
  256.  
  257. public fwCmdStart(id, uc_handle, seed)
  258. {
  259.     if(!is_valid_player(id))
  260.         return
  261.    
  262.     if(get_user_weapon(id)!=CSW_INFINITY)
  263.         return
  264.        
  265.     static buttons; buttons=get_uc(uc_handle, UC_Buttons)
  266.    
  267.     if(!(buttons&IN_ATTACK2))
  268.     {
  269.         g_mode[id]=0
  270.        
  271.         return
  272.     }  
  273.    
  274.     static ent; ent=get_pdata_cbase(id, 373)   
  275.    
  276.     if((buttons&IN_ATTACK)) /*Fix*/
  277.     {
  278.         set_pdata_float(ent, m_flNextPrimaryAttack, cvar_time_fire_normal,  OFFSET_LINUX_WEAPONS)
  279.        
  280.         g_mode[id]=0
  281.            
  282.         return 
  283.     }  
  284.    
  285.     if(get_pdata_int(ent, m_fInReload, OFFSET_LINUX_WEAPONS)||get_pdata_float(ent, m_flNextPrimaryAttack,  OFFSET_LINUX_WEAPONS)>-0.1)
  286.         return     
  287.    
  288.     g_mode[id]=1
  289.            
  290.     if(cs_get_weapon_ammo(ent)!=0)
  291.         ExecuteHamB(Ham_Weapon_PrimaryAttack, ent)
  292. }
  293.  
  294. public fwSetModel(ent, model[])
  295. {
  296.     if(!pev_valid(ent))
  297.         return FMRES_IGNORED;
  298.  
  299.     if(!equal(model, g_weapon_weaponbox_model))
  300.         return FMRES_IGNORED;
  301.  
  302.     static classname[33]
  303.     pev(ent, pev_classname, classname, charsmax(classname))
  304.        
  305.     if(!equal(classname, "weaponbox"))
  306.         return FMRES_IGNORED
  307.  
  308.     static owner; owner=pev(ent, pev_owner)
  309.     static weap;weap=fm_find_ent_by_owner(-1, g_weapon_entity, ent)
  310.    
  311.     if(g_HasInfinity[owner]&&pev_valid(weap))
  312.     {
  313.         set_pev(weap, pev_weaponkey, weaponkey_value)
  314.        
  315.         g_HasInfinity[owner]=false
  316.        
  317.         fm_entity_set_model(ent, WorldModel)
  318.        
  319.         return FMRES_SUPERCEDE
  320.     }
  321.    
  322.     return FMRES_IGNORED
  323. }
  324.  
  325. public fwAddToPlayer(ent, id)
  326. {
  327.     if(pev_valid(ent))
  328.     {
  329.         if(pev(ent, pev_weaponkey)==weaponkey_value)
  330.         {
  331.             g_HasInfinity[id] = true
  332.        
  333.             set_pev(ent, pev_weaponkey, 0)
  334.        
  335.             InfinitySprite(id)
  336.        
  337.             return HAM_HANDLED
  338.            
  339.         }
  340.     }
  341.        
  342.     return HAM_IGNORED
  343. }
  344.  
  345. public fwDeployPost(ent)
  346. {
  347.     new id=fm_get_weapon_owner(ent)
  348.  
  349.     if (!is_valid_player(id))
  350.         return
  351.    
  352.     set_pev(id, pev_viewmodel2, ViewModel)
  353.     set_pev(id, pev_weaponmodel2, PlayerModel)
  354.  
  355.     playanim(id, 15)
  356.  
  357.     set_pdata_float(ent, m_flNextPrimaryAttack, 0.8,  OFFSET_LINUX_WEAPONS)
  358.  
  359.     g_anim_mode[id]=!g_anim_mode[id]
  360. }
  361.    
  362. public fwPrimaryAttack(ent)
  363. {
  364.     new id=fm_get_weapon_owner(ent)
  365.    
  366.     if (!is_valid_player(id))
  367.         return
  368.    
  369.     pev(id,pev_punchangle,cl_pushangle[id])
  370.    
  371.     g_player_weapon_ammo[id]=cs_get_weapon_ammo(ent)
  372. }
  373.  
  374. public fwTraceAttackPost(ent, attacker, Float:damage, Float:dir[3], ptr, damage_type)
  375. {
  376.     if(!is_valid_player(attacker))
  377.         return
  378.  
  379.     if(get_user_weapon(attacker)!=CSW_INFINITY)
  380.         return
  381.            
  382.     static Float:fEnd[3]
  383.    
  384.     get_tr2(ptr, TR_vecEndPos, fEnd)
  385.    
  386.     make_bullet_decals(attacker, fEnd)
  387.    
  388.     g_hitgroup[attacker]=get_tr2(ptr, TR_iHitgroup)
  389. }
  390.  
  391. public fwReloadPre(ent)
  392. {
  393.     new id=fm_get_weapon_owner(ent)
  394.    
  395.     if(!is_valid_player(id))
  396.         return HAM_IGNORED
  397.  
  398.     static bpammo; bpammo=cs_get_user_bpammo(id, CSW_INFINITY)
  399.    
  400.     static clip; clip=cs_get_weapon_ammo(ent)
  401.    
  402.     if(bpammo>0&&clip<get_pcvar_num(pcvar_clipammo))
  403.     {
  404.         set_pdata_int(ent, 55, 0, OFFSET_LINUX_WEAPONS)
  405.        
  406.         set_pdata_float(id, m_flNextAttack, 4.4, OFFSET_LINUX)
  407.         set_pdata_float(ent, m_flTimeWeaponIdle, 4.4, OFFSET_LINUX_WEAPONS)
  408.         set_pdata_float(ent, m_flNextPrimaryAttack, 4.4, OFFSET_LINUX_WEAPONS)
  409.         set_pdata_float(ent, 47, 4.4, OFFSET_LINUX_WEAPONS)
  410.        
  411.         set_pdata_int(ent, m_fInReload, 1, OFFSET_LINUX_WEAPONS)
  412.  
  413.         playanim(id, 14)
  414.     }
  415.    
  416.     return HAM_SUPERCEDE
  417. }
  418.  
  419. public fwItemPostFrame(ent)
  420. {
  421.     new id=fm_get_weapon_owner(ent)
  422.    
  423.     if(!is_valid_player(id))
  424.         return
  425.    
  426.     static bpammo; bpammo=cs_get_user_bpammo(id, CSW_INFINITY)
  427.     static clip; clip=cs_get_weapon_ammo(ent)
  428.    
  429.     if(clip<g_player_weapon_ammo[id])
  430.     {
  431.         g_player_weapon_ammo[id]=clip
  432.    
  433.         new Float:push[3]
  434.    
  435.         pev(id,pev_punchangle,push)
  436.        
  437.         xs_vec_sub(push,cl_pushangle[id],push)
  438.         xs_vec_mul_scalar(push,0.8,push)
  439.         xs_vec_add(push,cl_pushangle[id],push)
  440.    
  441.         if(g_mode[id]==0)
  442.         {
  443.             if(g_shoot_anim[id]==0)
  444.             {
  445.  
  446.                 playanim(id, 2)
  447.             }
  448.             else
  449.             {
  450.                 playanim(id, 12)   
  451.             }
  452.            
  453.             set_pdata_float(ent, m_flNextPrimaryAttack, cvar_time_fire_normal, OFFSET_LINUX_WEAPONS)
  454.         }
  455.         else
  456.         {
  457.             if(g_shoot_anim[id]==0)
  458.             {
  459.                 playanim(id, (g_anim_mode[id])?18:16)
  460.                
  461.                 push[0]+=1.0
  462.                 push[1]-=1.5
  463.             }
  464.             else
  465.             {
  466.                 playanim(id, (g_anim_mode[id])?19:17)
  467.                
  468.                 push[0]+=1.0
  469.                 push[1]+=1.5
  470.             }
  471.            
  472.             set_pdata_float(ent, m_flNextPrimaryAttack,cvar_time_fire_fast, OFFSET_LINUX_WEAPONS)
  473.         }
  474.        
  475.         g_shoot_anim[id]=!g_shoot_anim[id]     
  476.                
  477.         set_pev(id,pev_punchangle,push)
  478.        
  479.         emit_sound(id, CHAN_WEAPON, Sounds[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  480.     }
  481.    
  482.     if(get_pdata_int(ent, m_fInReload, OFFSET_LINUX_WEAPONS)&&get_pdata_float(id, m_flNextAttack, 5) <= 0.0 )
  483.     {
  484.        
  485.         set_pdata_int(ent, m_fInReload, 0, OFFSET_LINUX_WEAPONS)
  486.        
  487.         for(new i = clip; i<get_pcvar_num(pcvar_clipammo); i++)
  488.         {
  489.             if(bpammo==0)
  490.                 break
  491.             bpammo--
  492.             clip++
  493.         }  
  494.        
  495.         cs_set_weapon_ammo(ent, clip)
  496.         cs_set_user_bpammo(id, CSW_INFINITY, bpammo)
  497.        
  498.     }
  499. }
  500.  
  501. public fwDamagePre(id, weapon, attacker, Float:damage)
  502. {
  503.    
  504.     if(!is_valid_player(attacker))
  505.         return
  506.    
  507.     if(get_user_weapon(attacker)!=CSW_INFINITY)
  508.         return
  509.    
  510.     new Float:Damage
  511.    
  512.     switch(g_hitgroup[attacker])
  513.     {
  514.        
  515.         case HIT_HEAD: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_head:pcvar_normal_damage_head)
  516.        
  517.         case HIT_CHEST: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_chest:pcvar_normal_damage_chest)
  518.        
  519.         case HIT_STOMACH: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_stomach:pcvar_normal_damage_stomach)
  520.        
  521.         case HIT_LEFTARM: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_arms:pcvar_normal_damage_arms)
  522.         case HIT_RIGHTARM: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_arms:pcvar_normal_damage_arms)
  523.        
  524.         case HIT_LEFTLEG: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_legs:pcvar_normal_damage_legs)
  525.         case HIT_RIGHTLEG: Damage=get_pcvar_float((g_mode[attacker])?pcvar_fast_damage_legs:pcvar_normal_damage_legs)
  526.        
  527.     }
  528.    
  529.     SetHamParamFloat(4, Damage)
  530. }
  531.  
  532. public fwRemoveItem(id, ent)
  533. {
  534.     if(!is_valid_player(id))
  535.         return
  536.        
  537.     new classname[62]
  538.    
  539.     pev(ent, pev_classname, classname, 61)
  540.    
  541.     if(!equal(classname, g_weapon_entity))
  542.         return
  543.    
  544.     DefaultSprite(id)
  545.        
  546. }
  547.  
  548. public make_bullet_decals(id, Float:Origin[3])
  549. {
  550.     new target, body
  551.     get_user_aiming(id, target, body, 999999)
  552.    
  553.     if(is_user_alive(target))
  554.     {
  555.         if(ze_is_user_zombie(id))
  556.         {
  557.             new Float:fStart[3], Float:fEnd[3], Float:fRes[3], Float:fVel[3]
  558.             pev(id, pev_origin, fStart)
  559.            
  560.             velocity_by_aim(id, 64, fVel)
  561.            
  562.             fStart[0] = Origin[0]
  563.             fStart[1] = Origin[1]
  564.             fStart[2] = Origin[2]
  565.             fEnd[0] = fStart[0]+fVel[0]
  566.             fEnd[1] = fStart[1]+fVel[1]
  567.             fEnd[2] = fStart[2]+fVel[2]
  568.    
  569.             new res
  570.             engfunc(EngFunc_TraceLine, fStart, fEnd, 0, target, res)
  571.             get_tr2(res, TR_vecEndPos, fRes)
  572.            
  573.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  574.             write_byte(TE_BLOODSPRITE)
  575.             write_coord(floatround(fStart[0]))
  576.             write_coord(floatround(fStart[1]))
  577.             write_coord(floatround(fStart[2]))
  578.             write_short(Blood[0])
  579.             write_short(Blood[1])
  580.             write_byte(70)
  581.             write_byte(random_num(1,2))
  582.             message_end()
  583.         }
  584.     }
  585.        
  586.     else
  587.     {
  588.         new decal = 41
  589.  
  590.         if(target)
  591.         {
  592.            
  593.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  594.             write_byte(TE_DECAL)
  595.             write_coord(floatround(Origin[0]))
  596.             write_coord(floatround(Origin[1]))
  597.             write_coord(floatround(Origin[2]))
  598.             write_byte(decal)
  599.             write_short(target)
  600.             message_end()
  601.         }
  602.         else
  603.         {  
  604.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  605.             write_byte(TE_WORLDDECAL)
  606.             write_coord(floatround(Origin[0]))
  607.             write_coord(floatround(Origin[1]))
  608.             write_coord(floatround(Origin[2]))
  609.             write_byte(decal)
  610.             message_end()
  611.         }
  612.        
  613.        
  614.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  615.         write_byte(TE_GUNSHOTDECAL)
  616.         write_coord(floatround(Origin[0]))
  617.         write_coord(floatround(Origin[1]))
  618.         write_coord(floatround(Origin[2]))
  619.         write_short(id)
  620.         write_byte(decal)
  621.         message_end()
  622.     }
  623. }
  624.  
  625. public InfinitySprite(id)
  626. {
  627.     message_begin( MSG_ONE, get_user_msgid("WeaponList"), .player=id )
  628.     write_string(weapon_list_txt)
  629.     write_byte(10)
  630.     write_byte(120)
  631.     write_byte(-1)
  632.     write_byte(-1)
  633.     write_byte(1)
  634.     write_byte(1)
  635.     write_byte(CSW_INFINITY)
  636.     write_byte(0)
  637.     message_end()
  638. }
  639.  
  640. public DefaultSprite(id)
  641. {
  642.     message_begin( MSG_ONE, get_user_msgid("WeaponList"), .player=id )
  643.     write_string(g_weapon_entity)
  644.     write_byte(10)
  645.     write_byte(120)
  646.     write_byte(-1)
  647.     write_byte(-1)
  648.     write_byte(1)
  649.     write_byte(1)
  650.     write_byte(CSW_INFINITY)
  651.     write_byte(0)
  652.     message_end()
  653. }
  654.  
  655. public is_valid_player(id)
  656. {
  657.        
  658.     if(!is_user_alive(id))
  659.         return false
  660.        
  661.     if(!g_HasInfinity[id])
  662.         return false
  663.  
  664.     return true
  665. }
  666.  
  667. stock drop_weapons(id, dropwhat)
  668. {
  669.     static weapons[32], num, i, weaponid
  670.     num = 0
  671.     get_user_weapons(id, weapons, num)
  672.    
  673.     for (i = 0; i < num; i++)
  674.     {
  675.         weaponid = weapons[i]
  676.        
  677.         if (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))
  678.         {
  679.             static wname[32]
  680.             get_weaponname(weaponid, wname, sizeof wname - 1)
  681.            
  682.             engclient_cmd(id, "drop", wname)
  683.         }
  684.     }
  685.    
  686. }
  687.  
  688. stock playanim(player,anim)
  689. {
  690.     set_pev(player, pev_weaponanim, anim)
  691.    
  692.     message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, player)
  693.     write_byte(anim)
  694.     write_byte(pev(player, pev_body))
  695.     message_end()
  696. }
  697.  
  698. stock fm_get_weapon_owner(weapon)
  699. {  
  700.     return get_pdata_cbase(weapon, 41, 4)
  701.    
  702. }
  703. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  704. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang16393\\ f0\\ fs16 \n\\ par }
  705. */

User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 6 years ago
Contact:

#3

Post by SexY DeviL CJ » 5 years ago

Hello a plugin is already made for this by raheem :D use it so it will block other weapon damage to in ( pre-release time, madness, while zm is frozen ) viewtopic.php?f=15&p=7677
......Devil Was Here......

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest