Reapi compatible?

Unpaid Requests, Public Plugins
Post Reply
Mystic Viper
Senior Member
Senior Member
Romania
Posts: 106
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

Reapi compatible?

#1

Post by Mystic Viper » 3 Months Ago

  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <engine>
  5. #include <fakemeta>
  6. #include <fakemeta_util>
  7. #include <hamsandwich>
  8. #include <zombieplague>
  9.  
  10. #include <orpheu>
  11.  
  12. #define PLUGIN "CSO Dreadnova"
  13. #define VERSION "1.0"
  14. #define AUTHOR "Asdian | Mellowzy"
  15.  
  16. #define CSW_RUNEBLADE CSW_KNIFE
  17. #define weapon_runeblade "weapon_knife"
  18.  
  19. #define v_model "models/v_summonknife.mdl"
  20. #define p_model "models/p_summonknife_a.mdl"
  21. #define p_model2 "models/p_summonknife_b.mdl"
  22. #define p_model3 "models/p_summonknife_charging.mdl"
  23. #define spr_wpn "knife_summonknife"
  24.  
  25. #define MODEL_FLAME "sprites/muzzleflash97.spr"
  26. #define MODEL_FLAME2 "sprites/muzzleflash98.spr"
  27. #define MODEL_MFSTAB "sprites/muzzleflash99.spr"
  28. #define MODEL_EFSTAB "sprites/ef_summon_stab1.spr"
  29. #define MODEL_EFCHARGE "sprites/ef_summon_charging.spr"
  30. #define MODEL_EFSTBATT "sprites/ef_summon_stab2.spr"
  31. #define MODEL_EFSTBMF "sprites/muzzleflash100.spr"
  32. #define MODEL_EFCHGLOOP "sprites/ef_summon_charging_loop.spr"
  33.  
  34. #define MODEL_EFSUMN_SMNING "models/ef_summoner_summoning.mdl"
  35. #define MODEL_EFSUMN_SMNING1 "sprites/ef_summoner_summon01.spr"
  36. #define MODEL_EFSUMN_SMNING2 "sprites/ef_summoner_summon02.spr"
  37. #define MODEL_EFSUMN_UNSMNING1 "sprites/ef_summoner_unsummon01.spr"
  38. #define MODEL_EFSUMN_UNSMNING2 "sprites/ef_summoner_unsummon02.spr"
  39. #define MODEL_EFSUMN_SWING "models/ef_summoner_swing.mdl"
  40.  
  41. #define SUMMONER_MDL "models/summoner.mdl"
  42. #define model_cannon "models/ef_summonknife_cannon.mdl"
  43.  
  44. new const weapon_sound[][] =
  45. {
  46.     "weapons/summonknife1.wav",             // 0
  47.     "weapons/summonknife2.wav",             // 1
  48.     "weapons/summonknife3.wav",             // 2
  49.     "weapons/summonknife4.wav",             // 3
  50.    
  51.     "weapons/summonknife_stab.wav",             // 4
  52.    
  53.     "weapons/katana_hit1.wav",              // 5
  54.     "weapons/katana_hit2.wav",              // 6
  55.     "weapons/katana_hitwall.wav",               // 7
  56.    
  57.     "weapons/summonknife_charging_loop.wav",        // 8
  58.     "weapons/summonknife_charging_relese.wav"       // 9
  59. }
  60.  
  61. new const summoner_sounds[][] =
  62. {
  63.     "weapons/summon_unsummon.wav",
  64.     "weapons/summon_summon.wav",
  65.     "weapons/summoning_ready.wav",
  66.     "weapons/summon_slash1.wav",
  67.     "weapons/summon_slash2.wav",
  68.     "weapons/summon_slash3.wav",
  69.     "weapons/summon_slash4.wav",
  70.     "weapons/summon_stab.wav",  // 7
  71.     "weapons/summon_stab_fire.wav"
  72. }
  73.  
  74. //SLASH
  75. #define SLASH_ANGLE         150.0
  76. #define SLASH_DAMAGE            152.0
  77. #define SLASH_RANGE         130.0
  78. #define SLASH_KNOCKBACK         1.0
  79.        
  80. //STAB
  81. #define STAB_ANGLE          180.0
  82. #define STAB_DAMAGE         210.0
  83. #define STAB_RANGE          200.0
  84. #define STAB_KNOCKBACK          21.0       
  85.  
  86. //CHARGE
  87. #define CHARGE_DAMAGE           250.0  
  88. #define CHARGE_RANGE            180.0
  89. #define CHARGE_ANGLE            102.0
  90. #define CHARGE_KNOCKBACK        195.0              
  91.  
  92. //SLASH SUMMONER
  93. #define SMNERSLASH_DAMAGE       90.0           
  94. #define SMNERSLASH_RANGE        120.0      
  95. #define SMNERSLASH_ANGLE        150.0      
  96. #define SMNERSLASH_KNOCKBACK        2.0        
  97.  
  98. //STAB SUMMONER
  99. #define SMNERSTAB_DAMAGE        190.0          
  100. #define SMNERSTAB_RANGE     185.0      
  101. #define SMNERSTAB_KNOCKBACK     50.0           
  102.  
  103. //Hit
  104. #define RESULT_HIT_NONE             0
  105. #define RESULT_HIT_PLAYER           1
  106. #define RESULT_HIT_WORLD            2
  107.  
  108. new g_had_runeblade[33], g_rb, Float:g_FUCK[33], Float:g_FUCK2[33], g_FUCK3[33], g_iStat[33], g_iCheck[33]
  109. new Float:g_SASKEHTimer[33], g_SASKEHAttack[33], g_SASKEHAmmo[33], Float:g_SASKEHAttTimer[33], g_SASKEHAttMod[33]
  110. new spr_blood_spray, spr_blood_drop, g_Exp_SprId, g_LaserID, g_LaserEXP
  111.  
  112. public plugin_init()
  113. {
  114.     register_plugin(PLUGIN, VERSION, AUTHOR)
  115.     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  116.     register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
  117.    
  118.     RegisterHam(Ham_Item_PostFrame, weapon_runeblade, "fw_Item_PostFrame")
  119.     RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn", 1);
  120.    
  121.     register_forward(FM_Think, "fw_MF_Think")
  122.     register_forward(FM_Touch, "fw_MF_Touch")
  123.     register_forward(FM_AddToFullPack, "Fw_AddToFullPack_Post", 1);
  124.    
  125.     g_rb = zp_register_extra_item("Dread Nova", 30, ZP_TEAM_HUMAN)
  126.     register_clcmd(spr_wpn, "hook_rb")
  127.    
  128.     register_cvar("test_rb", "1")
  129.     register_cvar("test_rbx", "0.88")
  130.     register_cvar("test_rby", "0.15")
  131. }
  132.  
  133. public client_connect(id) remove_crow9(id)
  134. public client_disconnect(id) remove_crow9(id)
  135.  
  136. public plugin_precache()
  137. {
  138.     precache_model(v_model)
  139.     precache_model(p_model)
  140.     precache_model(p_model2)
  141.     precache_model(p_model3)
  142.    
  143.     new i
  144.     for(i = 0; i < sizeof(weapon_sound); i++) precache_sound(weapon_sound[i])
  145.     for(i = 0; i < sizeof(summoner_sounds); i++) precache_sound(summoner_sounds[i])
  146.    
  147.     spr_blood_spray = precache_model("sprites/bloodspray.spr")
  148.     spr_blood_drop = precache_model("sprites/blood.spr")
  149.     g_Exp_SprId = precache_model("sprites/ef_summon_charging_exp.spr")
  150.     g_LaserID = precache_model("sprites/laserbeam.spr")
  151.     g_LaserEXP = precache_model("sprites/ef_summoner_stab1.spr")
  152.    
  153.     precache_model(MODEL_FLAME)
  154.     precache_model(MODEL_FLAME2)
  155.     precache_model(MODEL_MFSTAB)
  156.     precache_model(MODEL_EFSTAB)
  157.     precache_model(MODEL_EFCHARGE)
  158.     precache_model(MODEL_EFSTBATT)
  159.     precache_model(MODEL_EFSTBMF)
  160.     precache_model(MODEL_EFCHGLOOP)
  161.    
  162.     precache_model(SUMMONER_MDL)
  163.     precache_model(MODEL_EFSUMN_SMNING)
  164.     precache_model(MODEL_EFSUMN_SMNING1)
  165.     precache_model(MODEL_EFSUMN_SMNING2)
  166.     precache_model(MODEL_EFSUMN_UNSMNING1)
  167.     precache_model(MODEL_EFSUMN_UNSMNING2)
  168.     precache_model(MODEL_EFSUMN_SWING)
  169.     precache_model(model_cannon)
  170.    
  171.     new Txt[32]
  172.     format(Txt, 31, "sprites/%s.txt", spr_wpn)
  173.     engfunc(EngFunc_PrecacheGeneric, Txt)
  174.    
  175.     precache_sound("weapons/plasmagun_exp.wav")
  176. }
  177.  
  178. public hook_rb(id)
  179. {
  180.     engclient_cmd(id, weapon_runeblade)
  181.     return PLUGIN_HANDLED
  182. }
  183.  
  184. public zp_extra_item_selected(id, itemid) if(itemid == g_rb) get_runeblade(id)
  185. public zp_user_infected_post(id) remove_crow9(id)
  186. public fw_PlayerSpawn(id) remove_crow9(id)
  187.  
  188. public get_runeblade(id)
  189. {
  190.     if (!is_user_alive(id))
  191.         return
  192.  
  193.     g_had_runeblade[id] = 1
  194.     Reset_Values(id, 0, 1)
  195.    
  196.     if (get_user_weapon(id) == CSW_RUNEBLADE) Event_CurWeapon(id)
  197.     else engclient_cmd(id,weapon_runeblade)
  198. }
  199.  
  200. public remove_crow9(id)
  201. {
  202.     if(g_had_runeblade[id])
  203.     {
  204.         message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
  205.         write_string(weapon_runeblade)
  206.         write_byte(-1)
  207.         write_byte(-1)
  208.         write_byte(-1)
  209.         write_byte(-1)
  210.         write_byte(2)
  211.         write_byte(1)
  212.         write_byte(CSW_RUNEBLADE)
  213.         write_byte(0)
  214.         message_end()
  215.     }
  216.    
  217.     g_had_runeblade[id] = 0
  218. }
  219.  
  220. public Event_CurWeapon(id)
  221. {
  222.     if(!is_user_alive(id))
  223.         return 1
  224.     if(get_user_weapon(id) != CSW_RUNEBLADE)
  225.         return 1
  226.     if(!g_had_runeblade[id])
  227.         return 1
  228.        
  229.     static iEnt; iEnt = fm_get_user_weapon_entity(id, CSW_RUNEBLADE)
  230.     if(!pev_valid(iEnt)) return 1
  231.    
  232.     new iMode = pev(iEnt, pev_iuser2)
  233.     set_pev(id, pev_viewmodel2, v_model)
  234.     set_pev(id, pev_weaponmodel2, iMode?p_model2:p_model)
  235.     Set_WeaponAnim(id, iMode?11:6)
  236.    
  237.     set_pdata_float(id, 83, 1.0)
  238.     set_pdata_float(iEnt, 46, 1.03);
  239.     set_pdata_float(iEnt, 47, 1.03);
  240.     set_pdata_float(iEnt, 48, 1.03);
  241.    
  242.     Reset_Values(id, iEnt)
  243.    
  244.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
  245.     write_string(g_had_runeblade[id] == 1 ? spr_wpn : weapon_runeblade)
  246.     write_byte(1)
  247.     write_byte(100)
  248.     write_byte(-1)
  249.     write_byte(-1)
  250.     write_byte(2)
  251.     write_byte(1)
  252.     write_byte(CSW_RUNEBLADE)
  253.     write_byte(0)
  254.     message_end()
  255.    
  256.     return 0
  257. }
  258.  
  259. stock Reset_Values(id, iEnt2=0, totally=0)
  260. {
  261.     static iEnt
  262.     if(!iEnt2) iEnt = fm_get_user_weapon_entity(id, CSW_RUNEBLADE)
  263.     else iEnt = iEnt2
  264.    
  265.     if(!pev_valid(iEnt)) return 1
  266.    
  267.     set_pev(iEnt, pev_iuser1, 0)
  268.     if(totally) set_pev(iEnt, pev_iuser2, 0)
  269.     set_pev(iEnt, pev_iuser3, 0)
  270.     set_pev(iEnt, pev_iuser4, 0)
  271.    
  272.     g_iStat[id] = 0
  273.     g_iCheck[id] = 0
  274.    
  275.     g_FUCK[id] = 0.0
  276.     g_FUCK2[id] = 0.0
  277.     g_FUCK3[id] = 0
  278.    
  279.     if(totally) g_SASKEHAmmo[id] = 0
  280.     g_SASKEHAttack[id] = 0
  281.     g_SASKEHAttMod[id] = 0
  282.     g_SASKEHAttTimer[id] = 0.0
  283.     g_SASKEHTimer[id] = 0.0
  284.     return 0
  285. }
  286.  
  287. public message_DeathMsg(msg_id, msg_dest, msg_ent)
  288. {
  289.     new szWeapon[64], id
  290.     get_msg_arg_string(4, szWeapon, charsmax(szWeapon))
  291.     id = get_msg_arg_int(1)
  292.    
  293.     if(strcmp(szWeapon, "knife"))
  294.         return PLUGIN_CONTINUE
  295.  
  296.     new iEntity = get_pdata_cbase(id, 373)
  297.     if (!pev_valid(iEntity) || get_pdata_int(iEntity, 43, 4) != CSW_RUNEBLADE || !g_had_runeblade[id])
  298.         return PLUGIN_CONTINUE
  299.  
  300.     set_msg_arg_string(4, "summonknife")
  301.     return PLUGIN_CONTINUE
  302. }
  303.  
  304. public client_PostThink(id)
  305. {
  306.     if(!is_user_connected(id))
  307.         return  
  308.     if(!g_had_runeblade[id])
  309.         return
  310.    
  311.     static Wpn; Wpn = get_pdata_cbase(id, 373)
  312.     if(!pev_valid(Wpn)) return
  313.    
  314.     static Float:flLastCheckTime, Float:flSaskehHit
  315.     pev(Wpn, pev_fuser2, flLastCheckTime)
  316.     pev(Wpn, pev_fuser3, flSaskehHit)
  317.    
  318.     if(!g_SASKEHAttack[id] && flLastCheckTime < get_gametime())
  319.     {
  320.         if(g_SASKEHAmmo[id] == 100)
  321.             Stock_ScreenFade(id)
  322.        
  323.         if(g_SASKEHAmmo[id] < 100)
  324.         {
  325.             g_SASKEHAmmo[id]++
  326.            
  327.             if(get_user_weapon(id) == CSW_RUNEBLADE)
  328.             {
  329.                 DreadNova_UpdateAmmo(id)
  330.                
  331.                 if(g_SASKEHAmmo[id] == 100)
  332.                 {
  333.                     Stock_ScreenFade(id,0,155,255, 40)
  334.                     SendSound2(id, summoner_sounds[2])
  335.                    
  336.                     set_pev(Wpn, pev_fuser2, get_gametime() + 2.25)
  337.                     return
  338.                 }
  339.             }
  340.            
  341.             set_pev(Wpn, pev_fuser2, get_gametime() + 0.3)
  342.         }
  343.     }
  344.    
  345.     if(g_SASKEHAttack[id] && g_SASKEHAmmo[id] >= 0 && flLastCheckTime < get_gametime())
  346.     {
  347.         if(g_SASKEHAmmo[id] > 0) g_SASKEHAmmo[id]--
  348.         else g_SASKEHAmmo[id] = 0
  349.        
  350.         if(get_user_weapon(id) == CSW_RUNEBLADE)
  351.             DreadNova_UpdateAmmo(id)
  352.          
  353.         set_pev(Wpn, pev_fuser2, get_gametime() + 0.2) 
  354.     }
  355.    
  356.     // must hold the weapon
  357.     if(get_user_weapon(id) != CSW_RUNEBLADE)
  358.         return
  359.    
  360.     if(g_FUCK2[id] && g_FUCK2[id] < get_gametime())
  361.     {
  362.         if(g_FUCK3[id] == 2)
  363.         {
  364.             MakeMuzzleFlash(id, "rb_kobong", MODEL_EFSTBMF, 1, 0.2, 0.15, 0.75)
  365.             DN_Shoot_Cannon(id)
  366.         }
  367.         else if(g_FUCK3[id] == 1) MakeMuzzleFlash(id, "rb_kobong69", MODEL_EFCHARGE, 2, 0.2, 0.150, 0.7)
  368.         else if(g_FUCK3[id] == 3) MakeMuzzleFlash(id, "rb_kobong2", MODEL_EFCHGLOOP, 2, 0.1, 0.150, 3.0, 1)
  369.         g_FUCK2[id] = 0.0
  370.         if(g_FUCK3[id] != 3) g_FUCK3[id] = 0
  371.     }
  372.    
  373.     if(g_SASKEHAttack[id] && g_SASKEHTimer[id] && g_SASKEHTimer[id] < get_gametime())
  374.     {
  375.         remove_entity_name("saskeeeehhh")
  376.        
  377.         new Float:origin[3], Float:angles[3];
  378.         pev(id, pev_origin, origin)
  379.         pev(id, pev_angles, angles)
  380.         Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, 0, 0.0, 1)
  381.        
  382.         g_SASKEHTimer[id] = 0.0
  383.     }
  384.    
  385.     if(g_SASKEHAttack[id] && flSaskehHit && flSaskehHit < get_gametime())
  386.     {
  387.         if(g_SASKEHAttMod[id] == 5)
  388.         {
  389.             new pEnt = find_ent_by_class(id, "saskeeeehhh")
  390.             if(!pev_valid(pEnt)) return
  391.            
  392.             new Float:vecStart[3], Float:vecEnd[3], Float:vecAngles[3]
  393.             engfunc(EngFunc_GetAttachment, pEnt, 1, vecStart, vecAngles)
  394.             fm_get_aim_origin(id, vecEnd)
  395.             vecEnd[2] += 20.0
  396.            
  397.             for(new i = 0; i < 6; i++)
  398.             {
  399.                 engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vecStart, 0)
  400.                 write_byte(TE_BEAMPOINTS)
  401.                 engfunc(EngFunc_WriteCoord, vecStart[0]) // end
  402.                 engfunc(EngFunc_WriteCoord, vecStart[1])
  403.                 engfunc(EngFunc_WriteCoord, vecStart[2])
  404.                 engfunc(EngFunc_WriteCoord, vecEnd[0]) // start
  405.                 engfunc(EngFunc_WriteCoord, vecEnd[1])
  406.                 engfunc(EngFunc_WriteCoord, vecEnd[2])
  407.                 write_short(g_LaserID)
  408.                 write_byte(0)       // byte (starting frame)
  409.                 write_byte(35)      // byte (frame rate in 0.1's)
  410.                 write_byte(3)       // byte (life in 0.1's)
  411.                 write_byte(75)      // byte (line width in 0.1's)
  412.                 write_byte(0)       // byte (noise amplitude in 0.01's)
  413.                 write_byte(0)       // byte,byte,byte (color) (R)
  414.                 write_byte(200)     // (G)
  415.                 write_byte(200)     // (B)
  416.                 write_byte(255)     // byte (brightness)
  417.                 write_byte(0)       // byte (scroll speed in 0.1's)
  418.                 message_end()
  419.             }
  420.            
  421.             engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vecEnd, 0)
  422.             write_byte(TE_EXPLOSION)
  423.             engfunc(EngFunc_WriteCoord, vecEnd[0])
  424.             engfunc(EngFunc_WriteCoord, vecEnd[1])
  425.             engfunc(EngFunc_WriteCoord, vecEnd[2])
  426.             write_short(g_LaserEXP)
  427.             write_byte(15)//size
  428.             write_byte(35)//framerate
  429.             write_byte(TE_EXPLFLAG_NODLIGHTS|TE_EXPLFLAG_NOSOUND|TE_EXPLFLAG_NOPARTICLES)
  430.             message_end()
  431.            
  432.             SendSound2(id, summoner_sounds[8])
  433.            
  434.             new pEntity = -1
  435.             while((pEntity = engfunc(EngFunc_FindEntityInSphere, pEntity, vecEnd, SMNERSTAB_RANGE)) != 0)
  436.             {
  437.                 if(pev(pEntity, pev_takedamage) == DAMAGE_NO) continue
  438.                 if(is_user_connected(pEntity) && pEntity != id)
  439.                     if(!can_damage(pEntity, id)) continue
  440.                 if(pEntity == id) continue
  441.                
  442.                 if(pev_valid(pEntity))
  443.                 {
  444.                     ExecuteHamB(Ham_TakeDamage, pEntity, id, id, SMNERSTAB_DAMAGE, DMG_BULLET)
  445.                        
  446.                     Stock_Fake_KnockBack(id, pEntity, SMNERSTAB_KNOCKBACK)
  447.                     if(is_user_alive(pEntity)) SpawnBlood(vecEnd, get_pdata_int(pEntity,89), floatround(SMNERSTAB_DAMAGE/5.0))
  448.                 }
  449.             }
  450.         } else KnifeAttack_Setting(id, true, SMNERSLASH_RANGE, SMNERSLASH_ANGLE, SMNERSLASH_DAMAGE, SMNERSLASH_KNOCKBACK)
  451.        
  452.         set_pev(Wpn, pev_fuser3, 0.0)
  453.     }
  454. }
  455.  
  456. stock DreadNova_UpdateAmmo(id)
  457. {
  458.     if(!is_user_alive(id))
  459.         return
  460.  
  461.     static weapon_ent; weapon_ent = fm_get_user_weapon_entity(id, CSW_RUNEBLADE)
  462.     if(!pev_valid(weapon_ent)) return
  463.    
  464.     engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, get_user_msgid("CurWeapon"), {0, 0, 0}, id)
  465.     write_byte(1)
  466.     write_byte(CSW_RUNEBLADE)
  467.     write_byte(-1)
  468.     message_end()
  469.    
  470.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("AmmoX"), _, id)
  471.     write_byte(1)
  472.     write_byte(g_SASKEHAmmo[id])
  473.     message_end()
  474. }
  475.  
  476. public fw_Item_PostFrame(ent)
  477. {
  478.     new id = pev(ent, pev_owner)
  479.    
  480.     if(!is_user_connected(id))
  481.         return HAM_IGNORED
  482.     if(get_user_weapon(id) != CSW_RUNEBLADE || !g_had_runeblade[id])
  483.         return HAM_IGNORED
  484.    
  485.     new iMode = pev(ent, pev_iuser2)
  486.     new iCheck = pev(ent, pev_iuser3)
  487.    
  488.     if(get_pdata_float(ent, 48, 4) <= 0.0)
  489.     {
  490.         g_iCheck[id] = 0
  491.         Stock_ScreenFade(id)
  492.        
  493.         if(iMode && !iCheck)
  494.         {
  495.             set_pdata_float(ent, 48, 2.03,4);
  496.             Set_WeaponAnim(id, 7)
  497.         }
  498.     }
  499.    
  500.     new iButton = pev(id,pev_button)
  501.     return Lets_Kill_Them(id, ent, iButton)
  502. }
  503.  
  504. public Lets_Kill_Them(id, iEnt, iButton)
  505. {
  506.     new iState = pev(iEnt, pev_iuser1)
  507.     new iMode = pev(iEnt, pev_iuser2)
  508.     new iState2 = pev(iEnt, pev_iuser4)
  509.    
  510.     if(!(iButton & IN_ATTACK2) && iMode)
  511.     {
  512.         remove_entity_name("rb_kobong69")
  513.        
  514.         if((g_iStat[id] == 1 || g_iStat[id] == 4) && g_FUCK[id] < get_gametime())
  515.         {
  516.             g_FUCK[id] = 0.0
  517.             Set_WeaponAnim(id, 10)
  518.             set_pdata_float(iEnt, 46, 0.07,4);
  519.             set_pdata_float(iEnt, 47, 0.88,4);
  520.             set_pdata_float(iEnt, 48, 0.88,4);
  521.            
  522.             set_pev(iEnt, pev_iuser3, 0)
  523.             set_pev(iEnt, pev_iuser4, 0)
  524.            
  525.             g_iStat[id] = 0
  526.         }
  527.        
  528.         if(g_iStat[id] == 2 || g_iStat[id] == 3)
  529.         {
  530.             if(g_FUCK3[id])
  531.                 remove_entity_name("rb_kobong2")
  532.            
  533.             set_pev(id, pev_weaponmodel2, p_model2)
  534.             Set_WeaponAnim(id, 14)
  535.             SendSound(id, CHAN_WEAPON, weapon_sound[9])
  536.            
  537.             set_pdata_float(id, 83, 0.3, 5);
  538.             set_pdata_float(iEnt, 46, 0.86,4);
  539.             set_pdata_float(iEnt, 47, 1.76,4);
  540.             set_pdata_float(iEnt, 48, 0.86,4);
  541.            
  542.             set_pev(iEnt, pev_iuser3, 1)
  543.             set_pev(iEnt, pev_iuser4, 0)
  544.             set_pev(iEnt, pev_fuser4, get_gametime() + get_pdata_float(id, 83))
  545.            
  546.             g_iStat[id] = 4
  547.             g_FUCK[id] = get_gametime() + 0.86
  548.             g_FUCK2[id] = get_gametime() + 0.33
  549.             g_FUCK3[id] = 2
  550.            
  551.             MakeMuzzleFlash(id, "rb_kobong", MODEL_EFSTBATT, 1, 0.3, 0.3, 1.0)
  552.         }
  553.     }
  554.    
  555.     if(!(iButton & IN_ATTACK))
  556.     {
  557.         if(iState && get_pdata_float(iEnt, 48, 4) <= 0.0)
  558.         {
  559.             set_pev(iEnt, pev_iuser1, 0)
  560.            
  561.             set_pdata_float(iEnt, 48, 0.86,4);
  562.             Set_WeaponAnim(id, 5)
  563.         }
  564.     }
  565.    
  566.     if (get_pdata_float(id, 83) <= 0.0 && pev(iEnt, pev_iuser3) == 1)
  567.     {
  568.         if(g_iStat[id] == 1)
  569.         {
  570.             MakeMuzzleFlash(id, "rb_kobong", MODEL_EFSTAB, 4, 0.3, 0.01)
  571.             MakeMuzzleFlash(id, "rb_kobong", MODEL_MFSTAB, 1, 0.2, 0.15, 0.75)
  572.         }
  573.        
  574.         new iHitResult = KnifeAttack_Setting(id, 0, STAB_RANGE, STAB_ANGLE, STAB_DAMAGE, STAB_KNOCKBACK)
  575.         switch (iHitResult)
  576.         {
  577.             case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
  578.             case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
  579.         }
  580.         set_pev(iEnt, pev_iuser3, 0)
  581.     }
  582.    
  583.     if(get_pdata_float(iEnt, 46, 4) > 0.0)
  584.         return HAM_IGNORED
  585.    
  586.     if(iButton & IN_ATTACK)
  587.     {
  588.         set_pev(id, pev_weaponmodel2, p_model)
  589.         set_pev(iEnt, pev_iuser2, 0)
  590.        
  591.         if(g_SASKEHAttack[id] && g_SASKEHAttTimer[id] < get_gametime())
  592.         {
  593.             g_SASKEHAttMod[id] = random_num(1, 4)
  594.             remove_entity_name("saskeeeehhh")
  595.        
  596.             new Float:origin[3], Float:angles[3];
  597.             pev(id, pev_origin, origin)
  598.             pev(id, pev_angles, angles)
  599.             Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, g_SASKEHAttMod[id], 0.0, 1, 255.0, 0, 0, 0.0, 0.0, g_SASKEHAttMod[id] - 1)
  600.            
  601.             SendSound2(id, summoner_sounds[2 + g_SASKEHAttMod[id]])
  602.             set_pev(iEnt, pev_fuser3, get_gametime() + 0.3)
  603.            
  604.             g_SASKEHAttTimer[id] = get_gametime() + 1.0
  605.             g_SASKEHTimer[id] = get_gametime() + 1.35
  606.         }
  607.        
  608.         if(g_iCheck[id] == 3 && g_SASKEHAmmo[id] == 100)
  609.         {
  610.             g_iCheck[id] = 0
  611.             g_SASKEHAttack[id] = 1
  612.             Set_WeaponAnim(id, 15)
  613.             Stock_ScreenFade(id,0,155,255, 40)
  614.            
  615.             set_pdata_float(iEnt, 46, 1.3,4);
  616.             set_pdata_float(iEnt, 47, 1.5,4);
  617.             set_pdata_float(iEnt, 48, 1.35,4);
  618.            
  619.             remove_entity_name("saskeeeehhh")
  620.             g_SASKEHTimer[id] = get_gametime() + 2.86
  621.             g_SASKEHAttTimer[id] = get_gametime() + 2.85
  622.             SendSound2(id, summoner_sounds[1])
  623.            
  624.             new Float:origin[3], Float:angles[3];
  625.             pev(id, pev_origin, origin)
  626.             pev(id, pev_angles, angles)
  627.             Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, 6, 0.0, 1, 0.0, 0, 1)
  628.             Summon_SASKEEHH(id, "saskeeeehhh", MODEL_EFSUMN_SMNING, origin, angles, 0, 2.7, 1, 255.0, 1, 2, 0.01)
  629.            
  630.             new Float:origin2[3]
  631.             Stock_Get_Postion(id, 0.0, 0.0, 50.0, origin2)
  632.             Summon_SASKEEHH(id, "efx_saskeeeehhh", MODEL_EFSUMN_SMNING1, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 0.5, 0.3)
  633.             Summon_SASKEEHH(id, "efx_saskeeeehhh", MODEL_EFSUMN_SMNING2, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 1.0, 0.5)
  634.            
  635.             KnifeAttack_Setting(id, true, 160.0, 180.0, 0.0, 50.0)
  636.             return HAM_SUPERCEDE
  637.         }
  638.        
  639.         switch(iState)
  640.         {
  641.             case 0,1:
  642.             {
  643.                 Stock_SetPlayerAnim(id, "shoot_knife")
  644.                
  645.                 set_pdata_float(iEnt, 46, 0.16,4);
  646.                 set_pdata_float(iEnt, 47, 0.16,4);
  647.                 set_pdata_float(iEnt, 48, 0.53,4);
  648.        
  649.                 set_pev(iEnt, pev_iuser1, 2)
  650.                 Set_WeaponAnim(id, 1)
  651.                 SendSound(id, CHAN_WEAPON, weapon_sound[0])
  652.                
  653.                 new iHitResult = KnifeAttack_Setting(id, 0, SLASH_RANGE, SLASH_ANGLE, SLASH_DAMAGE, 0.0)
  654.                 switch (iHitResult)
  655.                 {
  656.                     case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
  657.                     case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
  658.                 }
  659.                
  660.                 if(!g_iCheck[id]) g_iCheck[id] = 1
  661.                 else g_iCheck[id] = 0
  662.             }
  663.             case 2:
  664.             {
  665.                 Stock_SetPlayerAnim(id, "shoot_knife")
  666.                
  667.                 set_pdata_float(iEnt, 46, 0.4,4);
  668.                 set_pdata_float(iEnt, 47, 0.4,4);
  669.                 set_pdata_float(iEnt, 48, 0.53,4);
  670.        
  671.                 set_pev(iEnt, pev_iuser1, 3)
  672.                 Set_WeaponAnim(id, 2)
  673.                 SendSound(id, CHAN_WEAPON, weapon_sound[1])
  674.                
  675.                 new iHitResult = KnifeAttack_Setting(id, 0, SLASH_RANGE, SLASH_ANGLE, SLASH_DAMAGE, 0.0)
  676.                 switch (iHitResult)
  677.                 {
  678.                     case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
  679.                     case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
  680.                 }
  681.             }
  682.             case 3:
  683.             {
  684.                 Stock_SetPlayerAnim(id, "shoot_knife")
  685.                
  686.                 set_pdata_float(iEnt, 46, 0.4,4);
  687.                 set_pdata_float(iEnt, 47, 0.4,4);
  688.                 set_pdata_float(iEnt, 48, 0.53,4);
  689.        
  690.                 set_pev(iEnt, pev_iuser1, 1)
  691.                
  692.                 if(!random_num(0,1))
  693.                 {
  694.                     Set_WeaponAnim(id, 3)
  695.                     SendSound(id, CHAN_WEAPON, weapon_sound[2])
  696.                     MakeMuzzleFlash(id, "rb_kobong", MODEL_FLAME, 1, 0.3, 0.01)
  697.                 } else {
  698.                     Set_WeaponAnim(id, 4)
  699.                     SendSound(id, CHAN_WEAPON, weapon_sound[3])
  700.                     MakeMuzzleFlash(id, "rb_kobong", MODEL_FLAME2, 1, 0.3, 0.01, 0.75)
  701.                 }
  702.                
  703.                 new iHitResult = KnifeAttack_Setting(id, 0, SLASH_RANGE, SLASH_ANGLE, SLASH_DAMAGE, 0.0)
  704.                 switch (iHitResult)
  705.                 {
  706.                     case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
  707.                     case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
  708.                 }
  709.             }
  710.         }
  711.     }
  712.    
  713.     if(iButton & IN_ATTACK2)
  714.     {
  715.         set_pev(iEnt, pev_iuser1, 0)
  716.         set_pev(iEnt, pev_iuser2, 1)
  717.         set_pev(iEnt, pev_iuser4, 0)
  718.        
  719.         if(g_SASKEHAttack[id] && g_SASKEHAttTimer[id] < get_gametime())
  720.         {
  721.             remove_entity_name("saskeeeehhh")
  722.             g_SASKEHAttMod[id] = 5
  723.            
  724.             new Float:origin[3], Float:angles[3];
  725.             pev(id, pev_origin, origin)
  726.             pev(id, pev_angles, angles)
  727.             Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, 5, 0.0, 1, 255.0)
  728.            
  729.             SendSound(id, CHAN_WEAPON, summoner_sounds[7])
  730.             set_pev(iEnt, pev_fuser3, get_gametime() + 0.66)
  731.            
  732.             g_SASKEHAttTimer[id] = get_gametime() + 0.72
  733.             g_SASKEHTimer[id] = get_gametime() + 2.03
  734.         }
  735.        
  736.         switch (iState2)
  737.         {
  738.             case 0:
  739.             {
  740.                 Stock_SetPlayerAnim(id, "shoot_knife")
  741.                 set_pev(id, pev_weaponmodel2, p_model2)
  742.                
  743.                 SendSound(id, CHAN_WEAPON, weapon_sound[4])
  744.                 Set_WeaponAnim(id, iMode ? 9 : 8)
  745.                 set_pdata_float(id, 83, 0.3, 5);
  746.                
  747.                 set_pev(iEnt, pev_iuser3, 1)
  748.                 set_pev(iEnt, pev_iuser4, 1)
  749.                 set_pev(iEnt, pev_fuser4, get_gametime() + get_pdata_float(id, 83))
  750.                
  751.                 g_iStat[id] = 1
  752.                 g_FUCK[id] = get_gametime() + 0.68
  753.                
  754.                 if(g_iCheck[id] == 1) g_iCheck[id] = 2
  755.                 else if(g_iCheck[id] == 2) g_iCheck[id] = 3
  756.                 else g_iCheck[id] = 0
  757.                
  758.                 set_pdata_float(iEnt, 46, 0.88,4);
  759.                 set_pdata_float(iEnt, 47, 1.0,4);
  760.                 set_pdata_float(iEnt, 48, 0.88,4);
  761.             }
  762.             case 1:
  763.             {
  764.                 g_FUCK[id] = get_gametime() + 0.1
  765.                 g_FUCK2[id] = get_gametime() + 0.66
  766.                 g_FUCK3[id] = 1
  767.                
  768.                 Set_WeaponAnim(id, 12)
  769.                 Stock_SetPlayerAnim(id, "aim_knife")
  770.                 set_pev(id, pev_weaponmodel2, p_model3)
  771.                
  772.                 set_pdata_float(iEnt, 46, 1.16,4);
  773.                 set_pdata_float(iEnt, 47, 1.53,4);
  774.                 set_pdata_float(iEnt, 48, 1.33,4);
  775.                
  776.                 set_pev(iEnt, pev_iuser4, 2)
  777.             }
  778.             case 2:
  779.             {
  780.                 g_iStat[id] = 2
  781.                 set_pev(iEnt, pev_iuser4, 3)
  782.                
  783.                 set_pdata_float(iEnt, 46, 0.37,4);
  784.                 set_pdata_float(iEnt, 47, 1.37,4);
  785.                 set_pdata_float(iEnt, 48, 0.37,4);
  786.                
  787.                 if(g_FUCK3[id] != 3)
  788.                 {
  789.                     g_FUCK3[id] = 3
  790.                     g_FUCK2[id] = get_gametime() + 0.1
  791.                 }
  792.             }
  793.             case 3:
  794.             {
  795.                 g_iStat[id] = 3
  796.                 set_pev(iEnt, pev_iuser4, 3)
  797.                
  798.                 set_pdata_float(iEnt, 46, 1.33,4);
  799.                 set_pdata_float(iEnt, 47, 1.53,4);
  800.                 set_pdata_float(iEnt, 48, 1.33,4);
  801.                
  802.                 Set_WeaponAnim(id, 13)
  803.                 SendSound(id, CHAN_WEAPON, weapon_sound[8])
  804.             }
  805.         }
  806.     }
  807.    
  808.     iButton &= ~IN_ATTACK;
  809.     iButton &= ~IN_ATTACK2;
  810.     set_pev(id, pev_button, iButton);
  811.     return HAM_IGNORED
  812. }
  813.  
  814. stock Summon_SASKEEHH(id, classname[], mdl[], Float:origin[3], Float:angles[3], seq, Float:fLife = 0.0, iRender=0, Float:fRender = 255.0, iDrop=0, stat=0, Float:fScales=0.0, Float:fFrmRate=0.0, iSlash=-1)
  815. {
  816.     new pEnt2 = Stock_CreateEntityBase(id, "info_target", MOVETYPE_FOLLOW, mdl, classname, SOLID_NOT, origin, 0.1)
  817.     set_pev(pEnt2, pev_gravity, 0.1);
  818.     set_pev(pEnt2, pev_angles, angles);
  819.     if(fScales > 0.0) set_pev(pEnt2, pev_scale, fScales);
  820.     engfunc(EngFunc_SetSize, pEnt2, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0})
  821.     set_pev(pEnt2, pev_frame, 0.0)
  822.     set_pev(pEnt2, pev_animtime, get_gametime())
  823.     set_pev(pEnt2, pev_framerate, 1.0)
  824.     set_pev(pEnt2, pev_sequence, seq)
  825.     set_pev(pEnt2, pev_iuser1, stat)
  826.     if(fLife > 0.0) set_pev(pEnt2, pev_ltime, get_gametime() + fLife)
  827.     if(iRender)
  828.     {
  829.         set_pev(pEnt2, pev_rendermode, kRenderTransAdd)
  830.         set_pev(pEnt2, pev_renderamt, fRender)
  831.     }
  832.     if(fFrmRate > 0.0) set_pev(pEnt2, pev_fuser1, fFrmRate)
  833.     if(iDrop) engfunc(EngFunc_DropToFloor, pEnt2)
  834.    
  835.     if(iSlash != -1) SASKEH_Slash(id, pEnt2, origin, angles, iSlash, 0.5, 0.25)
  836. }
  837.  
  838. stock SASKEH_Slash(id, iEnt, Float:origin[3], Float:angles[3], seq, Float:fLife = 0.0, Float:fScales=0.0)
  839. {
  840.     new pEnt2 = Stock_CreateEntityBase(id, "info_target", MOVETYPE_FOLLOW, MODEL_EFSUMN_SWING, "saskeh_slashefx", SOLID_NOT, origin, 0.1)
  841.     set_pev(pEnt2, pev_gravity, 0.1);
  842.     set_pev(pEnt2, pev_angles, angles);
  843.     set_pev(pEnt2, pev_scale, fScales);
  844.     engfunc(EngFunc_SetSize, pEnt2, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0})
  845.     set_pev(pEnt2, pev_frame, 0.0)
  846.     set_pev(pEnt2, pev_animtime, get_gametime())
  847.     set_pev(pEnt2, pev_framerate, 1.0)
  848.     set_pev(pEnt2, pev_sequence, seq)
  849.     set_pev(pEnt2, pev_iuser1, iEnt)
  850.     set_pev(pEnt2, pev_ltime, get_gametime() + fLife)
  851.     set_pev(pEnt2, pev_rendermode, kRenderTransAdd)
  852.     set_pev(pEnt2, pev_renderamt, 255.0)
  853. }
  854.  
  855. public Fw_AddToFullPack_Post(esState, iE, iEnt, iHost, iHostFlags, iPlayer, pSet)
  856. {
  857.     if (!pev_valid(iEnt))
  858.         return;
  859.     if (pev(iEnt, pev_flags) & FL_KILLME)
  860.         return;
  861.  
  862.     new Classname[32];
  863.     pev(iEnt, pev_classname, Classname, 31);
  864.  
  865.     if(equal(Classname, "rb_kobong") || equal(Classname, "rb_kobong2") || equal(Classname, "rb_kobong69"))
  866.     {
  867.         if (iHost != pev(iEnt, pev_owner))
  868.             set_es(esState, ES_Effects, (get_es(esState, ES_Effects) | EF_NODRAW));
  869.     }
  870. }
  871.  
  872. public fw_MF_Think(iEnt)
  873. {
  874.     if(!pev_valid(iEnt))
  875.         return
  876.    
  877.     static Classname[32], iOwner, iStat
  878.     pev(iEnt, pev_classname, Classname, sizeof(Classname))
  879.     iOwner = pev(iEnt, pev_owner)
  880.     iStat = pev(iEnt, pev_iuser1)
  881.    
  882.     if(equal(Classname, "saskeh_slashefx"))
  883.     {
  884.         set_pev(iEnt, pev_movetype, MOVETYPE_FLY)
  885.         set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)
  886.        
  887.         new Float:origin[3],Float:fOrigin[3], Float:vecAngle[3], iAttach
  888.         iAttach = pev(iEnt, pev_iuser1)
  889.        
  890.         if(!pev_valid(iAttach))
  891.         {
  892.             engfunc(EngFunc_RemoveEntity, iEnt)
  893.             return
  894.         }
  895.        
  896.         pev(iEnt, pev_origin, fOrigin)
  897.         pev(iAttach, pev_origin, origin)
  898.         pev(iAttach, pev_v_angle, vecAngle);
  899.        
  900.         vecAngle[0] = 0.0;
  901.         set_pev(iEnt, pev_v_angle, vecAngle);
  902.         set_pev(iEnt, pev_angles, vecAngle);
  903.  
  904.         static Float:fSpeed
  905.         fSpeed = floatmin(500.0, vector_distance(origin, fOrigin) * 9.0)
  906.         Stock_Hook_Ent(iEnt, origin, fSpeed, 1)
  907.        
  908.         if(pev(iEnt, pev_ltime) < get_gametime() || get_user_weapon(iOwner) != CSW_RUNEBLADE)
  909.         {
  910.             new Float:fRender
  911.             pev(iEnt, pev_renderamt, fRender)
  912.            
  913.             fRender -= 25.0
  914.             set_pev(iEnt, pev_renderamt, fRender)
  915.            
  916.             if(!fRender)
  917.             {
  918.                 engfunc(EngFunc_RemoveEntity, iEnt)
  919.                 return
  920.             }
  921.         }
  922.     }
  923.    
  924.     if(equal(Classname, "saskeeeehhh") || equal(Classname, "efx_saskeeeehhh"))
  925.     {
  926.         set_pev(iEnt, pev_movetype, MOVETYPE_FLY)
  927.         set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)
  928.        
  929.         new Float:origin[3],Float:fOrigin[3], Float:vecAngle[3]
  930.         pev(iEnt, pev_origin, fOrigin)
  931.         pev(iOwner, pev_origin, origin)
  932.         pev(iOwner, pev_v_angle, vecAngle);
  933.        
  934.         if(equal(Classname, "efx_saskeeeehhh"))
  935.             origin[2] += 50.0
  936.        
  937.         vecAngle[0] = 0.0;
  938.         set_pev(iEnt, pev_v_angle, vecAngle);
  939.         set_pev(iEnt, pev_angles, vecAngle);
  940.  
  941.         static Float:fSpeed
  942.         fSpeed = floatmin(500.0, vector_distance(origin, fOrigin) * 9.0)
  943.         Stock_Hook_Ent(iEnt, origin, fSpeed, 1)
  944.  
  945.         if(equal(Classname, "efx_saskeeeehhh"))
  946.         {
  947.             new Float:fFrameRate, Float:fFrame, Float:fFrameMax;
  948.             pev(iEnt, pev_frame, fFrame)
  949.             pev(iEnt, pev_fuser1, fFrameRate)
  950.             fFrameMax = float(engfunc(EngFunc_ModelFrames, pev(iEnt,pev_modelindex)))
  951.             fFrame += fFrameRate
  952.            
  953.             if(fFrame >= fFrameMax)
  954.             {
  955.                 set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME)
  956.                 return
  957.             }
  958.             set_pev(iEnt, pev_frame, fFrame)
  959.         } else {
  960.             if(iStat == 1)
  961.             {
  962.                 new Float:fRender
  963.                 pev(iEnt, pev_renderamt, fRender)
  964.                
  965.                 fRender += 1.0
  966.                 set_pev(iEnt, pev_renderamt, fRender)
  967.             }
  968.            
  969.             if(!iStat && (!g_SASKEHAmmo[iOwner] || get_user_weapon(iOwner) != CSW_RUNEBLADE))
  970.             {
  971.                 new Float:fRender
  972.                 pev(iEnt, pev_renderamt, fRender)
  973.                
  974.                 fRender -= 5.0
  975.                 set_pev(iEnt, pev_renderamt, fRender)
  976.                
  977.                 if(fRender == 175.0)
  978.                 {
  979.                     g_SASKEHAttack[iOwner] = 0
  980.                     g_SASKEHAttMod[iOwner] = 0
  981.                     engfunc(EngFunc_RemoveEntity, iEnt)
  982.                    
  983.                     new Float:origin2[3], Float:angles[3]
  984.                     pev(iOwner, pev_origin, origin2)
  985.                     pev(iOwner, pev_angles, angles)
  986.                     Summon_SASKEEHH(iOwner, "saskeeeehhh", SUMMONER_MDL, origin2, angles, 7, 1.0, 1, 175.0, 0, 3)
  987.            
  988.                     Stock_Get_Postion(iOwner, 0.0, 0.0, 50.0, origin2)
  989.                     Summon_SASKEEHH(iOwner, "efx_saskeeeehhh", MODEL_EFSUMN_UNSMNING1, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 0.5, 0.3)
  990.                     Summon_SASKEEHH(iOwner, "efx_saskeeeehhh", MODEL_EFSUMN_UNSMNING2, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 0.5, 0.5)
  991.                    
  992.                     SendSound2(iOwner, summoner_sounds[0])
  993.                     Stock_ScreenFade(iOwner,0,155,255, 40)
  994.                     return
  995.                 }
  996.             }
  997.            
  998.             if(iStat > 1 && (pev(iEnt, pev_ltime) < get_gametime() || get_user_weapon(iOwner) != CSW_RUNEBLADE))
  999.             {
  1000.                 if(iStat == 2)
  1001.                 {
  1002.                     engfunc(EngFunc_RemoveEntity, iEnt)
  1003.                     return
  1004.                 }
  1005.                
  1006.                 new Float:fRender
  1007.                 pev(iEnt, pev_renderamt, fRender)
  1008.                
  1009.                 fRender -= 5.0
  1010.                 set_pev(iEnt, pev_renderamt, fRender)
  1011.                
  1012.                 if(!fRender)
  1013.                 {
  1014.                     if(iStat == 3)
  1015.                     {
  1016.                         g_SASKEHAmmo[iOwner] = 0
  1017.                         Stock_ScreenFade(iOwner)
  1018.                     }
  1019.                     engfunc(EngFunc_RemoveEntity, iEnt)
  1020.                     return
  1021.                 }
  1022.             }
  1023.         }
  1024.     }
  1025.    
  1026.     if(equal(Classname, "rb_kobong") || equal(Classname, "rb_kobong69"))
  1027.     {
  1028.         new Float:fFrameRate, Float:fFrame, Float:fFrameMax;
  1029.         pev(iEnt, pev_frame, fFrame)
  1030.         pev(iEnt, pev_fuser1, fFrameRate)
  1031.         fFrameMax = float(engfunc(EngFunc_ModelFrames, pev(iEnt,pev_modelindex)))
  1032.  
  1033.         fFrame += fFrameRate
  1034.         set_pev(iEnt, pev_frame, fFrame)
  1035.         set_pev(iEnt, pev_nextthink, 0.01);
  1036.        
  1037.         if (fFrame >= fFrameMax || get_user_weapon(iOwner) != CSW_RUNEBLADE)
  1038.         {
  1039.             set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME);
  1040.             return;
  1041.         }
  1042.         return
  1043.     }
  1044.    
  1045.     if(equal(Classname, "rb_kobong2"))
  1046.     {
  1047.         new Float:fFrameRate, Float:fFrame, Float:fFrameMax
  1048.         pev(iEnt, pev_frame, fFrame)
  1049.         pev(iEnt, pev_fuser1, fFrameRate)
  1050.         fFrameMax = float(engfunc(EngFunc_ModelFrames, pev(iEnt,pev_modelindex)))
  1051.        
  1052.         fFrame += fFrameRate
  1053.         if(fFrame >= fFrameMax)
  1054.             fFrame = 0.0
  1055.        
  1056.         set_pev(iEnt, pev_frame, fFrame)
  1057.         set_pev(iEnt, pev_nextthink, get_gametime() + 0.035)
  1058.         return
  1059.     }
  1060.    
  1061.     if(equal(Classname, "DN_Cannon"))
  1062.     {
  1063.         static iOwner;
  1064.         iOwner = pev(iEnt, pev_owner)
  1065.         if(entity_range(iEnt, iOwner) > 750.0)
  1066.         {
  1067.             Explosions(iEnt, iOwner)
  1068.             set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME)
  1069.             return;
  1070.         }
  1071.         set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)
  1072.     }
  1073. }
  1074.  
  1075. public fw_MF_Touch(iEnt,iPtd)
  1076. {
  1077.     if(!pev_valid(iEnt))
  1078.         return HAM_IGNORED
  1079.    
  1080.     static Classname[32]
  1081.     pev(iEnt, pev_classname, Classname, sizeof(Classname))
  1082.    
  1083.     if(!equal(Classname, "DN_Cannon"))
  1084.         return HAM_IGNORED
  1085.        
  1086.     new iOwner, Float:vecOri[3]
  1087.     iOwner = pev(iEnt, pev_owner)
  1088.     pev(iEnt, pev_origin, vecOri)
  1089.    
  1090.     if(iPtd == iOwner)
  1091.         return HAM_IGNORED
  1092.    
  1093.     new Float:fOrigin[3]
  1094.     pev(iEnt, pev_origin, fOrigin)
  1095.  
  1096.     Explosions(iEnt, iOwner)
  1097.     engfunc(EngFunc_RemoveEntity, iEnt)
  1098.     return HAM_IGNORED
  1099. }
  1100.  
  1101. public Explosions(iPtr, iOwner)
  1102. {
  1103.     new Float:fOrigin[3]
  1104.     pev(iPtr, pev_origin, fOrigin)
  1105.    
  1106.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0)
  1107.     write_byte(TE_EXPLOSION)
  1108.     engfunc(EngFunc_WriteCoord, fOrigin[0])
  1109.     engfunc(EngFunc_WriteCoord, fOrigin[1])
  1110.     engfunc(EngFunc_WriteCoord, fOrigin[2])
  1111.     write_short(g_Exp_SprId)
  1112.     write_byte(7)
  1113.     write_byte(40)
  1114.     write_byte(TE_EXPLFLAG_NODLIGHTS | TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND)
  1115.     message_end()
  1116.    
  1117.     SendSound(iPtr, CHAN_VOICE, "weapons/plasmagun_exp.wav")
  1118.    
  1119.     new pEntity = -1
  1120.     while((pEntity = engfunc(EngFunc_FindEntityInSphere, pEntity, fOrigin, CHARGE_RANGE)) != 0)
  1121.     {
  1122.         if(pev(pEntity, pev_takedamage) == DAMAGE_NO) continue
  1123.         if(is_user_connected(pEntity) && pEntity != iOwner)
  1124.             if(!can_damage(pEntity, iOwner)) continue
  1125.         if(pEntity == iOwner) continue
  1126.        
  1127.         if(pev_valid(pEntity))
  1128.         {
  1129.             ExecuteHamB(Ham_TakeDamage, pEntity, iOwner, iOwner, CHARGE_DAMAGE, DMG_BULLET)
  1130.                
  1131.             Stock_Fake_KnockBack(iOwner, pEntity, CHARGE_KNOCKBACK)
  1132.             if(is_user_alive(pEntity)) SpawnBlood(fOrigin, get_pdata_int(pEntity,89), floatround(CHARGE_DAMAGE/5.0))
  1133.         }
  1134.     }
  1135. }
  1136. stock MakeMuzzleFlash(id, class[], model[], iBody, Float:fScale, Float:fNext, Float:fFrameRate = 1.0, iCheck = 0)
  1137. {
  1138.     new Float:fOrigin[3]
  1139.     pev(id, pev_origin, fOrigin)
  1140.    
  1141.     static iMuz
  1142.     iMuz = Stock_CreateEntityBase(id, "env_sprite", MOVETYPE_FOLLOW, model, class, SOLID_NOT,fOrigin,fNext)
  1143.     set_pev(iMuz, pev_body, iBody)
  1144.     set_pev(iMuz, pev_rendermode, kRenderTransAdd)
  1145.     set_pev(iMuz, pev_renderamt, 255.0)
  1146.     set_pev(iMuz, pev_aiment, id)
  1147.     set_pev(iMuz, pev_scale, fScale)
  1148.     set_pev(iMuz, pev_frame, 0.0)
  1149.     set_pev(iMuz, pev_fuser1, fFrameRate)
  1150.     if(iCheck)
  1151.     {
  1152.         set_pev(iMuz, pev_animtime, get_gametime())
  1153.         set_pev(iMuz, pev_framerate, 1.0)
  1154.     }
  1155.     dllfunc(DLLFunc_Spawn, iMuz)
  1156. }
  1157.  
  1158. public DN_Shoot_Cannon(id)
  1159. {
  1160.     static Float:vAvel[3],Float:targetOri[3], Float:vAngle[3], Float:vVelocity[3],Float:fOrigin2[3], Float:vPlayerVelocity[3];
  1161.     pev(id, pev_origin, fOrigin2)
  1162.     pev(id, pev_v_angle, vAngle)
  1163.     pev(id, pev_velocity, vPlayerVelocity);
  1164.     fm_get_aim_origin(id, targetOri)
  1165.    
  1166.     Stock_GetSpeedVector(fOrigin2, targetOri, 1550.0, vVelocity);
  1167.     xs_vec_add(vVelocity, vPlayerVelocity, vVelocity);
  1168.    
  1169.     vector_to_angle(vVelocity, vAngle)
  1170.     if(vAngle[0] > 90.0) vAngle[0] = -(360.0 - vAngle[0]);
  1171.    
  1172.     new iFlame = Stock_CreateEntityBase(id, "info_target", MOVETYPE_FLY, model_cannon, "DN_Cannon", SOLID_BBOX, fOrigin2, 0.01)
  1173.     set_pev(iFlame, pev_animtime, get_gametime())
  1174.     set_pev(iFlame, pev_framerate, 1.0)
  1175.     set_pev(iFlame ,pev_angles, vAngle)    
  1176.     set_pev(iFlame, pev_frame, 1.0)
  1177.     set_pev(iFlame, pev_scale, 1.5)
  1178.     set_pev(iFlame, pev_rendermode, kRenderTransAdd)
  1179.     set_pev(iFlame, pev_renderamt, 255.0)
  1180.     engfunc(EngFunc_SetSize, iFlame, {1.0,1.0,1.0}, {1.0,1.0,1.0})
  1181.    
  1182.     vAvel[2] = random_float(-200.0, 200.0)
  1183.     set_pev(iFlame, pev_avelocity, vAvel)
  1184.     set_pev(iFlame, pev_velocity, vVelocity)
  1185. }
  1186.  
  1187. stock Stock_CreateEntityBase(id, classtype[], mvtyp, mdl[], class[], solid, Float:fOrigin[3], Float:fNext)
  1188. {
  1189.     new pEntity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, classtype))
  1190.     set_pev(pEntity, pev_movetype, mvtyp);
  1191.     set_pev(pEntity, pev_owner, id);
  1192.     engfunc(EngFunc_SetModel, pEntity, mdl);
  1193.     set_pev(pEntity, pev_classname, class);
  1194.     set_pev(pEntity, pev_solid, solid);
  1195.     set_pev(pEntity, pev_origin, fOrigin);
  1196.     set_pev(pEntity, pev_nextthink, get_gametime() + fNext)
  1197.     return pEntity
  1198. }
  1199.  
  1200. stock Stock_ScreenFade(id,r=200,g=200,b=200,br=0)
  1201. {
  1202.     if(!is_user_alive(id))
  1203.         return
  1204.        
  1205.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, id)
  1206.     write_short((1<<12))//duration
  1207.     write_short((1<<12) * 1) //Hold
  1208.     write_short(0x0004) //Type
  1209.     write_byte(r) //R
  1210.     write_byte(g) //G
  1211.     write_byte(b) //B
  1212.     write_byte(br) //B
  1213.     message_end()
  1214. }
  1215.  
  1216. stock SendSound(id, chan, sample[]) emit_sound(id, chan, sample, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  1217. stock SendSound2(id, iSound[])
  1218. {
  1219.     if(!is_user_alive(id))
  1220.         return
  1221.        
  1222.     client_cmd(id, "spk %s", iSound)
  1223. }
  1224.  
  1225. stock KnifeAttack_Setting(id, bStab, Float:flRange, Float:fAngle, Float:flDamage, Float:flKnockBack)
  1226. {
  1227.     new iHitResult
  1228.     if(fAngle > 0.0) iHitResult = KnifeAttack2(id, bStab, Float:flRange, Float:fAngle, Float:flDamage, Float:flKnockBack)
  1229.     else iHitResult = KnifeAttack(id, bStab, Float:flRange, Float:flDamage, Float:flKnockBack)
  1230.  
  1231.     return iHitResult
  1232. }
  1233.  
  1234. stock KnifeAttack(id, bStab, Float:flRange, Float:flDamage, Float:flKnockBack, iHitgroup = -1, bitsDamageType = DMG_NEVERGIB | DMG_CLUB)
  1235. {
  1236.     new Float:vecSrc[3], Float:vecEnd[3], Float:v_angle[3], Float:vecForward[3];
  1237.     GetGunPosition(id, vecSrc);
  1238.  
  1239.     pev(id, pev_v_angle, v_angle);
  1240.     engfunc(EngFunc_MakeVectors, v_angle);
  1241.  
  1242.     global_get(glb_v_forward, vecForward);
  1243.     xs_vec_mul_scalar(vecForward, flRange, vecForward);
  1244.     xs_vec_add(vecSrc, vecForward, vecEnd);
  1245.  
  1246.     new tr = create_tr2();
  1247.     engfunc(EngFunc_TraceLine, vecSrc, vecEnd, 0, id, tr);
  1248.  
  1249.     new Float:flFraction; get_tr2(tr, TR_flFraction, flFraction);
  1250.     if (flFraction >= 1.0) engfunc(EngFunc_TraceHull, vecSrc, vecEnd, 0, 3, id, tr);
  1251.    
  1252.     get_tr2(tr, TR_flFraction, flFraction);
  1253.  
  1254.     new Float:EndPos2[3]
  1255.     get_tr2(tr, TR_vecEndPos, EndPos2)
  1256.    
  1257.     new iHitResult = RESULT_HIT_NONE;
  1258.    
  1259.     if (flFraction < 1.0)
  1260.     {
  1261.         iHitResult = RESULT_HIT_WORLD;
  1262.        
  1263.         new pEntity = get_tr2(tr, TR_pHit);
  1264.         if (pev_valid(pEntity) && (IsPlayer(pEntity) || IsHostage(pEntity)))
  1265.         {
  1266.             if (CheckBack(id, pEntity) && bStab && iHitgroup == -1)
  1267.                 flDamage *= 3.0;
  1268.            
  1269.             iHitResult = RESULT_HIT_PLAYER;
  1270.         }
  1271.  
  1272.         if (pev_valid(pEntity))
  1273.         {
  1274.             engfunc(EngFunc_MakeVectors, v_angle);
  1275.             global_get(glb_v_forward, vecForward);
  1276.  
  1277.             if (iHitgroup != -1)
  1278.                 set_tr2(tr, TR_iHitgroup, iHitgroup);
  1279.  
  1280.             OrpheuCall(OrpheuGetFunction("ClearMultiDamage"))
  1281.             ExecuteHamB(Ham_TraceAttack, pEntity, id, flDamage, vecForward, tr, bitsDamageType);
  1282.             OrpheuCall(OrpheuGetFunction("ApplyMultiDamage"), id, id)
  1283.            
  1284.             Stock_Fake_KnockBack(id, pEntity, flKnockBack)
  1285.            
  1286.             if (IsAlive(pEntity))
  1287.             {
  1288.                 free_tr2(tr);
  1289.                 return iHitResult;
  1290.             }
  1291.         }
  1292.     }
  1293.     free_tr2(tr);
  1294.     return iHitResult;
  1295. }
  1296.  
  1297. stock KnifeAttack2(id, bStab, Float:flRange, Float:fAngle, Float:flDamage, Float:flKnockBack, iHitgroup = -1, bitsDamageType = DMG_NEVERGIB | DMG_CLUB, bNoTraceCheck = 0)
  1298. {
  1299.     new Float:vecOrigin[3], Float:vecSrc[3], Float:vecEnd[3], Float:v_angle[3], Float:vecForward[3];
  1300.     pev(id, pev_origin, vecOrigin);
  1301.  
  1302.     new iHitResult = RESULT_HIT_NONE;
  1303.     GetGunPosition(id, vecSrc);
  1304.  
  1305.     pev(id, pev_v_angle, v_angle);
  1306.     engfunc(EngFunc_MakeVectors, v_angle);
  1307.  
  1308.     global_get(glb_v_forward, vecForward);
  1309.     xs_vec_mul_scalar(vecForward, flRange, vecForward);
  1310.     xs_vec_add(vecSrc, vecForward, vecEnd);
  1311.  
  1312.     new tr = create_tr2();
  1313.     engfunc(EngFunc_TraceLine, vecSrc, vecEnd, 0, id, tr);
  1314.  
  1315.     new Float:flFraction;
  1316.     get_tr2(tr, TR_flFraction, flFraction);
  1317.  
  1318.     if (flFraction < 1.0) iHitResult = RESULT_HIT_WORLD;
  1319.  
  1320.     new Float:vecEndZ = vecEnd[2];
  1321.  
  1322.     new pEntity = -1;
  1323.     while ((pEntity = engfunc(EngFunc_FindEntityInSphere, pEntity, vecOrigin, flRange)) != 0)
  1324.     {
  1325.         if (!pev_valid(pEntity))
  1326.             continue;
  1327.         if (id == pEntity)
  1328.             continue;
  1329.         if (!IsAlive(pEntity))
  1330.             continue;
  1331.         if (!CheckAngle(id, pEntity, fAngle))
  1332.             continue;
  1333.  
  1334.         GetGunPosition(id, vecSrc);
  1335.         Stock_Get_Origin(pEntity, vecEnd);
  1336.  
  1337.         vecEnd[2] = vecSrc[2] + (vecEndZ - vecSrc[2]) * (get_distance_f(vecSrc, vecEnd) / flRange);
  1338.  
  1339.         xs_vec_sub(vecEnd, vecSrc, vecForward);
  1340.         xs_vec_normalize(vecForward, vecForward);
  1341.         xs_vec_mul_scalar(vecForward, flRange, vecForward);
  1342.         xs_vec_add(vecSrc, vecForward, vecEnd);
  1343.  
  1344.         engfunc(EngFunc_TraceLine, vecSrc, vecEnd, 0, id, tr);
  1345.         get_tr2(tr, TR_flFraction, flFraction);
  1346.  
  1347.         if (flFraction >= 1.0) engfunc(EngFunc_TraceHull, vecSrc, vecEnd, 0, 3, id, tr);
  1348.         get_tr2(tr, TR_flFraction, flFraction);
  1349.  
  1350.         if (flFraction < 1.0)
  1351.         {
  1352.             if (IsPlayer(pEntity) || IsHostage(pEntity))
  1353.             {
  1354.                 iHitResult = RESULT_HIT_PLAYER;
  1355.  
  1356.                 if (CheckBack(id, pEntity) && bStab && iHitgroup == -1)
  1357.                     flDamage *= 3.0;
  1358.             }
  1359.  
  1360.             if (get_tr2(tr, TR_pHit) == pEntity || bNoTraceCheck)
  1361.             {
  1362.                 engfunc(EngFunc_MakeVectors, v_angle);
  1363.                 global_get(glb_v_forward, vecForward);
  1364.  
  1365.                 if (iHitgroup != -1) set_tr2(tr, TR_iHitgroup, iHitgroup);
  1366.  
  1367.                 OrpheuCall(OrpheuGetFunction("ClearMultiDamage"))
  1368.                 ExecuteHamB(Ham_TraceAttack, pEntity, id, flDamage, vecForward, tr, bitsDamageType);
  1369.                 OrpheuCall(OrpheuGetFunction("ApplyMultiDamage"), id, id)
  1370.  
  1371.                 Stock_Fake_KnockBack(id, pEntity, flKnockBack)
  1372.             }
  1373.         }
  1374.         free_tr2(tr);
  1375.     }
  1376.     return iHitResult;
  1377. }
  1378.  
  1379. stock Set_WeaponAnim(id, anim)
  1380. {
  1381.     set_pev(id, pev_weaponanim, anim)
  1382.    
  1383.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id)
  1384.     write_byte(anim)
  1385.     write_byte(pev(id, pev_body))
  1386.     message_end()
  1387. }
  1388.  
  1389. stock Stock_SetPlayerAnim(id, const AnimName[], Float:rate=1.0)
  1390. {
  1391.     static AnimNum, Float:FrameRate, Float:GroundSpeed, bool:Loops, Anim2[64]
  1392.     if(!(pev(id, pev_flags) & FL_DUCKING)) format(Anim2, 63, "ref_%s", AnimName)
  1393.     else format(Anim2, 63, "crouch_%s", AnimName)
  1394.  
  1395.     if ((AnimNum=lookup_sequence(id,Anim2,FrameRate,Loops,GroundSpeed))==-1) AnimNum=0
  1396.    
  1397.     if (!Loops || (Loops && pev(id,pev_sequence)!=AnimNum))
  1398.     {
  1399.         set_pev(id, pev_gaitsequence, AnimNum)
  1400.         set_pev(id, pev_sequence, AnimNum)
  1401.         set_pev(id, pev_frame, 0.0)
  1402.         set_pev(id, pev_animtime, get_gametime())
  1403.     }
  1404.     set_pev(id, pev_framerate, rate)
  1405.  
  1406.     set_pdata_int(id, 40, Loops, 4)
  1407.     set_pdata_int(id, 39, 0, 4)
  1408.  
  1409.     set_pdata_float(id, 36, FrameRate, 4)
  1410.     set_pdata_float(id, 37, GroundSpeed, 4)
  1411.     set_pdata_float(id, 38, get_gametime(), 4)
  1412.  
  1413.     set_pdata_int(id, 73, 28, 5)
  1414.     set_pdata_int(id, 74, 28, 5)
  1415.     set_pdata_float(id, 220, get_gametime(), 5)
  1416. }
  1417.  
  1418. stock Set_PlayerNextAttack(id, Float:nexttime)
  1419. {
  1420.     set_pdata_float(id, 83, nexttime, 5)
  1421. }
  1422.  
  1423. stock Make_EffSprite(Float:fOrigin[3],bStab)
  1424. {
  1425.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0)
  1426.     write_byte(TE_EXPLOSION)
  1427.     engfunc(EngFunc_WriteCoord, fOrigin[0])
  1428.     engfunc(EngFunc_WriteCoord, fOrigin[1])
  1429.     engfunc(EngFunc_WriteCoord, fOrigin[2])
  1430.     write_short(bStab?spr1:spr2)
  1431.     write_byte(bStab?6:3)
  1432.     write_byte(40)
  1433.     write_byte(TE_EXPLFLAG_NODLIGHTS | TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND)
  1434.     message_end()
  1435. }
  1436.  
  1437. stock Make_EffSprite2(Float:fOrigin[3])
  1438. {
  1439.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0)
  1440.     write_byte(TE_EXPLOSION)
  1441.     engfunc(EngFunc_WriteCoord, fOrigin[0])
  1442.     engfunc(EngFunc_WriteCoord, fOrigin[1])
  1443.     engfunc(EngFunc_WriteCoord, fOrigin[2])
  1444.     write_short(spr3)
  1445.     write_byte(2)
  1446.     write_byte(48)
  1447.     write_byte(TE_EXPLFLAG_NODLIGHTS | TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND)
  1448.     message_end()
  1449. }
  1450.  
  1451. stock Stock_Get_Postion(id,Float:forw,Float:right,Float:up,Float:vStart[])
  1452. {
  1453.     static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
  1454.     pev(id, pev_origin, vOrigin)
  1455.     pev(id, pev_view_ofs,vUp)
  1456.     xs_vec_add(vOrigin,vUp,vOrigin)
  1457.     pev(id, pev_v_angle, vAngle)
  1458.    
  1459.     engfunc(EngFunc_AngleVectors, vAngle, vForward, vRight, vUp)
  1460.    
  1461.     vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up
  1462.     vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up
  1463.     vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up
  1464. }
  1465.  
  1466. stock IsPlayer(pEntity) return is_user_connected(pEntity)
  1467.  
  1468. stock IsHostage(pEntity)
  1469. {
  1470.     new classname[32]; pev(pEntity, pev_classname, classname, charsmax(classname))
  1471.     return equal(classname, "hostage_entity")
  1472. }
  1473.  
  1474. stock IsAlive(pEntity)
  1475. {
  1476.     if (pEntity < 1) return 0
  1477.     return (pev(pEntity, pev_deadflag) == DEAD_NO && pev(pEntity, pev_health) > 0)
  1478. }
  1479.  
  1480. stock GetGunPosition(id, Float:vecScr[3])
  1481. {
  1482.     new Float:vecViewOfs[3]
  1483.     pev(id, pev_origin, vecScr)
  1484.     pev(id, pev_view_ofs, vecViewOfs)
  1485.     xs_vec_add(vecScr, vecViewOfs, vecScr)
  1486. }
  1487.  
  1488. stock CheckBack(iEnemy,id)
  1489. {
  1490.     new Float:anglea[3], Float:anglev[3]
  1491.     pev(iEnemy, pev_v_angle, anglea)
  1492.     pev(id, pev_v_angle, anglev)
  1493.     new Float:angle = anglea[1] - anglev[1]
  1494.     if (angle < -180.0) angle += 360.0
  1495.     if (angle <= 45.0 && angle >= -45.0) return 1
  1496.     return 0
  1497. }
  1498.  
  1499. stock CheckAngle(iAttacker, iVictim, Float:fAngle)  return(Stock_CheckAngle(iAttacker, iVictim) > floatcos(fAngle,degrees))
  1500.  
  1501. stock Float:Stock_CheckAngle(id,iTarget)
  1502. {
  1503.     new Float:vOricross[2],Float:fRad,Float:vId_ori[3],Float:vTar_ori[3],Float:vId_ang[3],Float:fLength,Float:vForward[3]
  1504.     Stock_Get_Origin(id, vId_ori)
  1505.     Stock_Get_Origin(iTarget, vTar_ori)
  1506.    
  1507.     pev(id,pev_angles,vId_ang)
  1508.     for(new i=0;i<2;i++) vOricross[i] = vTar_ori[i] - vId_ori[i]
  1509.    
  1510.     fLength = floatsqroot(vOricross[0]*vOricross[0] + vOricross[1]*vOricross[1])
  1511.    
  1512.     if (fLength<=0.0)
  1513.     {
  1514.         vOricross[0]=0.0
  1515.         vOricross[1]=0.0
  1516.     } else {
  1517.         vOricross[0]=vOricross[0]*(1.0/fLength)
  1518.         vOricross[1]=vOricross[1]*(1.0/fLength)
  1519.     }
  1520.    
  1521.     engfunc(EngFunc_MakeVectors,vId_ang)
  1522.     global_get(glb_v_forward,vForward)
  1523.    
  1524.     fRad = vOricross[0]*vForward[0]+vOricross[1]*vForward[1]
  1525.    
  1526.     return fRad   //->   RAD 90' = 0.5rad
  1527. }
  1528.  
  1529. stock Stock_Get_Origin(id, Float:origin[3])
  1530. {
  1531.     new Float:maxs[3],Float:mins[3]
  1532.     if (pev(id, pev_solid) == SOLID_BSP)
  1533.     {
  1534.         pev(id,pev_maxs,maxs)
  1535.         pev(id,pev_mins,mins)
  1536.         origin[0] = (maxs[0] - mins[0]) / 2 + mins[0]
  1537.         origin[1] = (maxs[1] - mins[1]) / 2 + mins[1]
  1538.         origin[2] = (maxs[2] - mins[2]) / 2 + mins[2]
  1539.     } else pev(id, pev_origin, origin)
  1540. }
  1541.  
  1542. stock Stock_GetSpeedVector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
  1543. {
  1544.     xs_vec_sub(origin2, origin1, new_velocity)
  1545.     new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
  1546.     xs_vec_mul_scalar(new_velocity, num, new_velocity)
  1547. }
  1548.  
  1549. stock SpawnBlood(const Float:vecOrigin[3], iColor, iAmount)
  1550. {
  1551.     if(iAmount == 0)
  1552.         return
  1553.  
  1554.     if (!iColor)
  1555.         return
  1556.  
  1557.     iAmount *= 2
  1558.     if(iAmount > 255) iAmount = 255
  1559.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vecOrigin)
  1560.     write_byte(TE_BLOODSPRITE)
  1561.     engfunc(EngFunc_WriteCoord, vecOrigin[0])
  1562.     engfunc(EngFunc_WriteCoord, vecOrigin[1])
  1563.     engfunc(EngFunc_WriteCoord, vecOrigin[2])
  1564.     write_short(spr_blood_spray)
  1565.     write_short(spr_blood_drop)
  1566.     write_byte(iColor)
  1567.     write_byte(min(max(3, iAmount / 10), 16))
  1568.     message_end()
  1569. }
  1570.  
  1571. public Stock_Fake_KnockBack(id, iVic, Float:iKb)
  1572. {
  1573.     if(iVic > 32) return
  1574.    
  1575.     new Float:vAttacker[3], Float:vVictim[3], Float:vVelocity[3], flags
  1576.     pev(id, pev_origin, vAttacker)
  1577.     pev(iVic, pev_origin, vVictim)
  1578.     vAttacker[2] = vVictim[2] = 0.0
  1579.     flags = pev(id, pev_flags)
  1580.    
  1581.     xs_vec_sub(vVictim, vAttacker, vVictim)
  1582.     new Float:fDistance
  1583.     fDistance = xs_vec_len(vVictim)
  1584.     xs_vec_mul_scalar(vVictim, 1 / fDistance, vVictim)
  1585.    
  1586.     pev(iVic, pev_velocity, vVelocity)
  1587.     xs_vec_mul_scalar(vVictim, iKb, vVictim)
  1588.     xs_vec_mul_scalar(vVictim, 50.0, vVictim)
  1589.     vVictim[2] = xs_vec_len(vVictim) * 0.15
  1590.    
  1591.     if(flags &~ FL_ONGROUND)
  1592.     {
  1593.         xs_vec_mul_scalar(vVictim, 1.2, vVictim)
  1594.         vVictim[2] *= 0.4
  1595.     }
  1596.     if(xs_vec_len(vVictim) > xs_vec_len(vVelocity)) set_pev(iVic, pev_velocity, vVictim)
  1597. }  
  1598.  
  1599. stock Float:Stock_Get_Body_Dmg(iBody)
  1600. {
  1601.     switch (iBody)
  1602.     {
  1603.         case HIT_GENERIC: return 0.75
  1604.         case 1: return 4.0
  1605.         case 2: return 1.0
  1606.         case 3: return 1.25
  1607.         case 4,5,6,7: return 0.75
  1608.         default: return 0.75
  1609.     }
  1610.     return 1.0
  1611. }
  1612.  
  1613. stock Stock_BloodEffect(Float:vecOri[3], scale)
  1614. {
  1615.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  1616.     write_byte(TE_BLOODSPRITE)
  1617.     engfunc(EngFunc_WriteCoord,vecOri[0])
  1618.     engfunc(EngFunc_WriteCoord,vecOri[1])
  1619.     engfunc(EngFunc_WriteCoord,vecOri[2])
  1620.     write_short(spr_blood_spray)
  1621.     write_short(spr_blood_drop)
  1622.     write_byte(75)
  1623.     write_byte(scale)
  1624.     message_end()
  1625. }
  1626. stock can_damage(id1, id2)
  1627. {
  1628.     if(id1 <= 0 || id1 >= 33 || id2 <= 0 || id2 >= 33)
  1629.         return 1
  1630.        
  1631.     // Check team
  1632.     return(get_pdata_int(id1, 114) != get_pdata_int(id2, 114))
  1633. }
  1634. ///////
  1635. stock Stock_Hook_Ent(ent, Float:TargetOrigin[3], Float:Speed, mode=0)
  1636. {
  1637.     static Float:fl_Velocity[3],Float:EntOrigin[3],Float:distance_f,Float:fl_Time
  1638.     pev(ent, pev_origin, EntOrigin)
  1639.    
  1640.     if(!mode)
  1641.     {
  1642.         distance_f = get_distance_f(EntOrigin, TargetOrigin)
  1643.         fl_Time = distance_f / Speed
  1644.            
  1645.         pev(ent, pev_velocity, fl_Velocity)
  1646.            
  1647.         fl_Velocity[0] = (TargetOrigin[0] - EntOrigin[0]) / fl_Time
  1648.         fl_Velocity[1] = (TargetOrigin[1] - EntOrigin[1]) / fl_Time
  1649.         fl_Velocity[2] = (TargetOrigin[2] - EntOrigin[2]) / fl_Time
  1650.  
  1651.         if(vector_length(fl_Velocity) > 1.0) set_pev(ent, pev_velocity, fl_Velocity)
  1652.         else set_pev(ent, pev_velocity, Float:{0.01, 0.01, 0.01})
  1653.     } else {
  1654.         static Float:fl_EntVelocity[3], Float:fl_Acc[3]
  1655.         Stock_Directed_Vector(TargetOrigin, EntOrigin, fl_Velocity)
  1656.         xs_vec_mul_scalar(fl_Velocity, Speed, fl_Velocity)
  1657.        
  1658.         for(new i =0; i<3; i++)
  1659.         {
  1660.             if(fl_Velocity[i] > fl_EntVelocity[i])
  1661.             {
  1662.                 fl_Acc[i] = fl_Velocity[i]-fl_EntVelocity[i]
  1663.                 fl_Acc[i] = floatmin(70.0, fl_Acc[i])
  1664.                 fl_EntVelocity[i] += fl_Acc[i]
  1665.             }
  1666.             else if(fl_Velocity[i] < fl_EntVelocity[i])
  1667.             {
  1668.                 fl_Acc[i] = fl_EntVelocity[i]-fl_Velocity[i]
  1669.                 fl_Acc[i] = floatmin(70.0, fl_Acc[i])
  1670.                 fl_EntVelocity[i] -= fl_Acc[i]
  1671.             }
  1672.         }
  1673.         set_pev(ent, pev_velocity, fl_EntVelocity)
  1674.     }
  1675. }
  1676.  
  1677. stock Stock_Directed_Vector(Float:start[3],Float:end[3],Float:reOri[3])
  1678. {  
  1679.     new Float:v3[3]
  1680.     v3[0]=start[0]-end[0]
  1681.     v3[1]=start[1]-end[1]
  1682.     v3[2]=start[2]-end[2]
  1683.     new Float:vl = vector_length(v3)
  1684.     reOri[0] = v3[0] / vl
  1685.     reOri[1] = v3[1] / vl
  1686.     reOri[2] = v3[2] / vl
  1687. }
I need this to be converted from orpheu to reapi

User avatar
Muhammet20
Veteran Member
Veteran Member
Turkey
Posts: 408
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 15
Contact:

#2

Post by Muhammet20 » 3 Months Ago

you can simply add the orpheu module to your modules.ini
i think no one can convert a plugins from orpheu to reapi
but if you want i converted it to ze

Code: Select all

/* Plugin generated by AMXX-Studio */
 
#include <engine>
#include <fakemeta_util>
#include <zombie_escape>
#include <orpheu>
 
#define PLUGIN "CSO Dreadnova"
#define VERSION "1.0"
#define AUTHOR "Asdian | Mellowzy"
 
#define CSW_RUNEBLADE CSW_KNIFE
#define weapon_runeblade "weapon_knife"
 
#define v_model "models/v_summonknife.mdl"
#define p_model "models/p_summonknife_a.mdl"
#define p_model2 "models/p_summonknife_b.mdl"
#define p_model3 "models/p_summonknife_charging.mdl"
#define spr_wpn "knife_summonknife"
 
#define MODEL_FLAME "sprites/muzzleflash97.spr"
#define MODEL_FLAME2 "sprites/muzzleflash98.spr"
#define MODEL_MFSTAB "sprites/muzzleflash99.spr"
#define MODEL_EFSTAB "sprites/ef_summon_stab1.spr"
#define MODEL_EFCHARGE "sprites/ef_summon_charging.spr"
#define MODEL_EFSTBATT "sprites/ef_summon_stab2.spr"
#define MODEL_EFSTBMF "sprites/muzzleflash100.spr"
#define MODEL_EFCHGLOOP "sprites/ef_summon_charging_loop.spr"
 
#define MODEL_EFSUMN_SMNING "models/ef_summoner_summoning.mdl"
#define MODEL_EFSUMN_SMNING1 "sprites/ef_summoner_summon01.spr"
#define MODEL_EFSUMN_SMNING2 "sprites/ef_summoner_summon02.spr"
#define MODEL_EFSUMN_UNSMNING1 "sprites/ef_summoner_unsummon01.spr"
#define MODEL_EFSUMN_UNSMNING2 "sprites/ef_summoner_unsummon02.spr"
#define MODEL_EFSUMN_SWING "models/ef_summoner_swing.mdl"
 
#define SUMMONER_MDL "models/summoner.mdl"
#define model_cannon "models/ef_summonknife_cannon.mdl"
 
new const weapon_sound[][] =
{
    "weapons/summonknife1.wav",             // 0
    "weapons/summonknife2.wav",             // 1
    "weapons/summonknife3.wav",             // 2
    "weapons/summonknife4.wav",             // 3
   
    "weapons/summonknife_stab.wav",             // 4
   
    "weapons/katana_hit1.wav",              // 5
    "weapons/katana_hit2.wav",              // 6
    "weapons/katana_hitwall.wav",               // 7
   
    "weapons/summonknife_charging_loop.wav",        // 8
    "weapons/summonknife_charging_relese.wav"       // 9
}
 
new const summoner_sounds[][] =
{
    "weapons/summon_unsummon.wav",
    "weapons/summon_summon.wav",
    "weapons/summoning_ready.wav",
    "weapons/summon_slash1.wav",
    "weapons/summon_slash2.wav",
    "weapons/summon_slash3.wav",
    "weapons/summon_slash4.wav",
    "weapons/summon_stab.wav",  // 7
    "weapons/summon_stab_fire.wav"
}
 
//SLASH
#define SLASH_ANGLE         150.0
#define SLASH_DAMAGE            152.0
#define SLASH_RANGE         130.0
#define SLASH_KNOCKBACK         1.0
       
//STAB
#define STAB_ANGLE          180.0
#define STAB_DAMAGE         210.0
#define STAB_RANGE          200.0
#define STAB_KNOCKBACK          21.0       
 
//CHARGE
#define CHARGE_DAMAGE           250.0  
#define CHARGE_RANGE            180.0
#define CHARGE_ANGLE            102.0
#define CHARGE_KNOCKBACK        195.0              
 
//SLASH SUMMONER
#define SMNERSLASH_DAMAGE       90.0           
#define SMNERSLASH_RANGE        120.0      
#define SMNERSLASH_ANGLE        150.0      
#define SMNERSLASH_KNOCKBACK        2.0        
 
//STAB SUMMONER
#define SMNERSTAB_DAMAGE        190.0          
#define SMNERSTAB_RANGE     185.0      
#define SMNERSTAB_KNOCKBACK     50.0           
 
//Hit
#define RESULT_HIT_NONE             0
#define RESULT_HIT_PLAYER           1
#define RESULT_HIT_WORLD            2
 
new g_had_runeblade[33], g_rb, Float:g_FUCK[33], Float:g_FUCK2[33], g_FUCK3[33], g_iStat[33], g_iCheck[33]
new Float:g_SASKEHTimer[33], g_SASKEHAttack[33], g_SASKEHAmmo[33], Float:g_SASKEHAttTimer[33], g_SASKEHAttMod[33]
new spr_blood_spray, spr_blood_drop, g_Exp_SprId, g_LaserID, g_LaserEXP
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
    register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
   
    RegisterHam(Ham_Item_PostFrame, weapon_runeblade, "fw_Item_PostFrame")
    RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn", 1);
   
    register_forward(FM_Think, "fw_MF_Think")
    register_forward(FM_Touch, "fw_MF_Touch")
    register_forward(FM_AddToFullPack, "Fw_AddToFullPack_Post", 1);
   
    g_rb = ze_register_item("Dread Nova", 30, 0)
    register_clcmd(spr_wpn, "hook_rb")
   
    register_cvar("test_rb", "1")
    register_cvar("test_rbx", "0.88")
    register_cvar("test_rby", "0.15")
}
 
public client_connect(id) remove_crow9(id)
public client_disconnect(id) remove_crow9(id)
 
public plugin_precache()
{
    precache_model(v_model)
    precache_model(p_model)
    precache_model(p_model2)
    precache_model(p_model3)
   
    new i
    for(i = 0; i < sizeof(weapon_sound); i++) precache_sound(weapon_sound[i])
    for(i = 0; i < sizeof(summoner_sounds); i++) precache_sound(summoner_sounds[i])
   
    spr_blood_spray = precache_model("sprites/bloodspray.spr")
    spr_blood_drop = precache_model("sprites/blood.spr")
    g_Exp_SprId = precache_model("sprites/ef_summon_charging_exp.spr")
    g_LaserID = precache_model("sprites/laserbeam.spr")
    g_LaserEXP = precache_model("sprites/ef_summoner_stab1.spr")
   
    precache_model(MODEL_FLAME)
    precache_model(MODEL_FLAME2)
    precache_model(MODEL_MFSTAB)
    precache_model(MODEL_EFSTAB)
    precache_model(MODEL_EFCHARGE)
    precache_model(MODEL_EFSTBATT)
    precache_model(MODEL_EFSTBMF)
    precache_model(MODEL_EFCHGLOOP)
   
    precache_model(SUMMONER_MDL)
    precache_model(MODEL_EFSUMN_SMNING)
    precache_model(MODEL_EFSUMN_SMNING1)
    precache_model(MODEL_EFSUMN_SMNING2)
    precache_model(MODEL_EFSUMN_UNSMNING1)
    precache_model(MODEL_EFSUMN_UNSMNING2)
    precache_model(MODEL_EFSUMN_SWING)
    precache_model(model_cannon)
   
    new Txt[32]
    format(Txt, 31, "sprites/%s.txt", spr_wpn)
    engfunc(EngFunc_PrecacheGeneric, Txt)
   
    precache_sound("weapons/plasmagun_exp.wav")
}
 
public hook_rb(id)
{
    engclient_cmd(id, weapon_runeblade)
    return PLUGIN_HANDLED
}
 
public ze_select_item_post(id, itemid) if(itemid == g_rb) get_runeblade(id)
public ze_user_infected(iVictim, iInfector) remove_crow9(iVictim)
public fw_PlayerSpawn(id) remove_crow9(id)
 
public get_runeblade(id)
{
    if (!is_user_alive(id))
        return
 
    g_had_runeblade[id] = 1
    Reset_Values(id, 0, 1)
   
    if (get_user_weapon(id) == CSW_RUNEBLADE) Event_CurWeapon(id)
    else engclient_cmd(id,weapon_runeblade)
}
 
public remove_crow9(id)
{
    if(g_had_runeblade[id])
    {
        message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
        write_string(weapon_runeblade)
        write_byte(-1)
        write_byte(-1)
        write_byte(-1)
        write_byte(-1)
        write_byte(2)
        write_byte(1)
        write_byte(CSW_RUNEBLADE)
        write_byte(0)
        message_end()
    }
   
    g_had_runeblade[id] = 0
}
 
public Event_CurWeapon(id)
{
    if(!is_user_alive(id))
        return 1
    if(get_user_weapon(id) != CSW_RUNEBLADE)
        return 1
    if(!g_had_runeblade[id])
        return 1
       
    static iEnt; iEnt = fm_get_user_weapon_entity(id, CSW_RUNEBLADE)
    if(!pev_valid(iEnt)) return 1
   
    new iMode = pev(iEnt, pev_iuser2)
    set_pev(id, pev_viewmodel2, v_model)
    set_pev(id, pev_weaponmodel2, iMode?p_model2:p_model)
    Set_WeaponAnim(id, iMode?11:6)
   
    set_pdata_float(id, 83, 1.0)
    set_pdata_float(iEnt, 46, 1.03);
    set_pdata_float(iEnt, 47, 1.03);
    set_pdata_float(iEnt, 48, 1.03);
   
    Reset_Values(id, iEnt)
   
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
    write_string(g_had_runeblade[id] == 1 ? spr_wpn : weapon_runeblade)
    write_byte(1)
    write_byte(100)
    write_byte(-1)
    write_byte(-1)
    write_byte(2)
    write_byte(1)
    write_byte(CSW_RUNEBLADE)
    write_byte(0)
    message_end()
   
    return 0
}
 
stock Reset_Values(id, iEnt2=0, totally=0)
{
    static iEnt
    if(!iEnt2) iEnt = fm_get_user_weapon_entity(id, CSW_RUNEBLADE)
    else iEnt = iEnt2
   
    if(!pev_valid(iEnt)) return 1
   
    set_pev(iEnt, pev_iuser1, 0)
    if(totally) set_pev(iEnt, pev_iuser2, 0)
    set_pev(iEnt, pev_iuser3, 0)
    set_pev(iEnt, pev_iuser4, 0)
   
    g_iStat[id] = 0
    g_iCheck[id] = 0
   
    g_FUCK[id] = 0.0
    g_FUCK2[id] = 0.0
    g_FUCK3[id] = 0
   
    if(totally) g_SASKEHAmmo[id] = 0
    g_SASKEHAttack[id] = 0
    g_SASKEHAttMod[id] = 0
    g_SASKEHAttTimer[id] = 0.0
    g_SASKEHTimer[id] = 0.0
    return 0
}
 
public message_DeathMsg(msg_id, msg_dest, msg_ent)
{
    new szWeapon[64], id
    get_msg_arg_string(4, szWeapon, charsmax(szWeapon))
    id = get_msg_arg_int(1)
   
    if(strcmp(szWeapon, "knife"))
        return PLUGIN_CONTINUE
 
    new iEntity = get_pdata_cbase(id, 373)
    if (!pev_valid(iEntity) || get_pdata_int(iEntity, 43, 4) != CSW_RUNEBLADE || !g_had_runeblade[id])
        return PLUGIN_CONTINUE
 
    set_msg_arg_string(4, "summonknife")
    return PLUGIN_CONTINUE
}
 
public client_PostThink(id)
{
    if(!is_user_connected(id))
        return  
    if(!g_had_runeblade[id])
        return
   
    static Wpn; Wpn = get_pdata_cbase(id, 373)
    if(!pev_valid(Wpn)) return
   
    static Float:flLastCheckTime, Float:flSaskehHit
    pev(Wpn, pev_fuser2, flLastCheckTime)
    pev(Wpn, pev_fuser3, flSaskehHit)
   
    if(!g_SASKEHAttack[id] && flLastCheckTime < get_gametime())
    {
        if(g_SASKEHAmmo[id] == 100)
            Stock_ScreenFade(id)
       
        if(g_SASKEHAmmo[id] < 100)
        {
            g_SASKEHAmmo[id]++
           
            if(get_user_weapon(id) == CSW_RUNEBLADE)
            {
                DreadNova_UpdateAmmo(id)
               
                if(g_SASKEHAmmo[id] == 100)
                {
                    Stock_ScreenFade(id,0,155,255, 40)
                    SendSound2(id, summoner_sounds[2])
                   
                    set_pev(Wpn, pev_fuser2, get_gametime() + 2.25)
                    return
                }
            }
           
            set_pev(Wpn, pev_fuser2, get_gametime() + 0.3)
        }
    }
   
    if(g_SASKEHAttack[id] && g_SASKEHAmmo[id] >= 0 && flLastCheckTime < get_gametime())
    {
        if(g_SASKEHAmmo[id] > 0) g_SASKEHAmmo[id]--
        else g_SASKEHAmmo[id] = 0
       
        if(get_user_weapon(id) == CSW_RUNEBLADE)
            DreadNova_UpdateAmmo(id)
         
        set_pev(Wpn, pev_fuser2, get_gametime() + 0.2) 
    }
   
    // must hold the weapon
    if(get_user_weapon(id) != CSW_RUNEBLADE)
        return
   
    if(g_FUCK2[id] && g_FUCK2[id] < get_gametime())
    {
        if(g_FUCK3[id] == 2)
        {
            MakeMuzzleFlash(id, "rb_kobong", MODEL_EFSTBMF, 1, 0.2, 0.15, 0.75)
            DN_Shoot_Cannon(id)
        }
        else if(g_FUCK3[id] == 1) MakeMuzzleFlash(id, "rb_kobong69", MODEL_EFCHARGE, 2, 0.2, 0.150, 0.7)
        else if(g_FUCK3[id] == 3) MakeMuzzleFlash(id, "rb_kobong2", MODEL_EFCHGLOOP, 2, 0.1, 0.150, 3.0, 1)
        g_FUCK2[id] = 0.0
        if(g_FUCK3[id] != 3) g_FUCK3[id] = 0
    }
   
    if(g_SASKEHAttack[id] && g_SASKEHTimer[id] && g_SASKEHTimer[id] < get_gametime())
    {
        remove_entity_name("saskeeeehhh")
       
        new Float:origin[3], Float:angles[3];
        pev(id, pev_origin, origin)
        pev(id, pev_angles, angles)
        Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, 0, 0.0, 1)
       
        g_SASKEHTimer[id] = 0.0
    }
   
    if(g_SASKEHAttack[id] && flSaskehHit && flSaskehHit < get_gametime())
    {
        if(g_SASKEHAttMod[id] == 5)
        {
            new pEnt = find_ent_by_class(id, "saskeeeehhh")
            if(!pev_valid(pEnt)) return
           
            new Float:vecStart[3], Float:vecEnd[3], Float:vecAngles[3]
            engfunc(EngFunc_GetAttachment, pEnt, 1, vecStart, vecAngles)
            fm_get_aim_origin(id, vecEnd)
            vecEnd[2] += 20.0
           
            for(new i = 0; i < 6; i++)
            {
                engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vecStart, 0)
                write_byte(TE_BEAMPOINTS)
                engfunc(EngFunc_WriteCoord, vecStart[0]) // end
                engfunc(EngFunc_WriteCoord, vecStart[1])
                engfunc(EngFunc_WriteCoord, vecStart[2])
                engfunc(EngFunc_WriteCoord, vecEnd[0]) // start
                engfunc(EngFunc_WriteCoord, vecEnd[1])
                engfunc(EngFunc_WriteCoord, vecEnd[2])
                write_short(g_LaserID)
                write_byte(0)       // byte (starting frame)
                write_byte(35)      // byte (frame rate in 0.1's)
                write_byte(3)       // byte (life in 0.1's)
                write_byte(75)      // byte (line width in 0.1's)
                write_byte(0)       // byte (noise amplitude in 0.01's)
                write_byte(0)       // byte,byte,byte (color) (R)
                write_byte(200)     // (G)
                write_byte(200)     // (B)
                write_byte(255)     // byte (brightness)
                write_byte(0)       // byte (scroll speed in 0.1's)
                message_end()
            }
           
            engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vecEnd, 0)
            write_byte(TE_EXPLOSION)
            engfunc(EngFunc_WriteCoord, vecEnd[0])
            engfunc(EngFunc_WriteCoord, vecEnd[1])
            engfunc(EngFunc_WriteCoord, vecEnd[2])
            write_short(g_LaserEXP)
            write_byte(15)//size
            write_byte(35)//framerate
            write_byte(TE_EXPLFLAG_NODLIGHTS|TE_EXPLFLAG_NOSOUND|TE_EXPLFLAG_NOPARTICLES)
            message_end()
           
            SendSound2(id, summoner_sounds[8])
           
            new pEntity = -1
            while((pEntity = engfunc(EngFunc_FindEntityInSphere, pEntity, vecEnd, SMNERSTAB_RANGE)) != 0)
            {
                if(pev(pEntity, pev_takedamage) == DAMAGE_NO) continue
                if(is_user_connected(pEntity) && pEntity != id)
                    if(!can_damage(pEntity, id)) continue
                if(pEntity == id) continue
               
                if(pev_valid(pEntity))
                {
                    ExecuteHamB(Ham_TakeDamage, pEntity, id, id, SMNERSTAB_DAMAGE, DMG_BULLET)
                       
                    Stock_Fake_KnockBack(id, pEntity, SMNERSTAB_KNOCKBACK)
                    if(is_user_alive(pEntity)) SpawnBlood(vecEnd, get_pdata_int(pEntity,89), floatround(SMNERSTAB_DAMAGE/5.0))
                }
            }
        } else KnifeAttack_Setting(id, true, SMNERSLASH_RANGE, SMNERSLASH_ANGLE, SMNERSLASH_DAMAGE, SMNERSLASH_KNOCKBACK)
       
        set_pev(Wpn, pev_fuser3, 0.0)
    }
}
 
stock DreadNova_UpdateAmmo(id)
{
    if(!is_user_alive(id))
        return
 
    static weapon_ent; weapon_ent = fm_get_user_weapon_entity(id, CSW_RUNEBLADE)
    if(!pev_valid(weapon_ent)) return
   
    engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, get_user_msgid("CurWeapon"), {0, 0, 0}, id)
    write_byte(1)
    write_byte(CSW_RUNEBLADE)
    write_byte(-1)
    message_end()
   
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("AmmoX"), _, id)
    write_byte(1)
    write_byte(g_SASKEHAmmo[id])
    message_end()
}
 
public fw_Item_PostFrame(ent)
{
    new id = pev(ent, pev_owner)
   
    if(!is_user_connected(id))
        return HAM_IGNORED
    if(get_user_weapon(id) != CSW_RUNEBLADE || !g_had_runeblade[id])
        return HAM_IGNORED
   
    new iMode = pev(ent, pev_iuser2)
    new iCheck = pev(ent, pev_iuser3)
   
    if(get_pdata_float(ent, 48, 4) <= 0.0)
    {
        g_iCheck[id] = 0
        Stock_ScreenFade(id)
       
        if(iMode && !iCheck)
        {
            set_pdata_float(ent, 48, 2.03,4);
            Set_WeaponAnim(id, 7)
        }
    }
   
    new iButton = pev(id,pev_button)
    return Lets_Kill_Them(id, ent, iButton)
}
 
public Lets_Kill_Them(id, iEnt, iButton)
{
    new iState = pev(iEnt, pev_iuser1)
    new iMode = pev(iEnt, pev_iuser2)
    new iState2 = pev(iEnt, pev_iuser4)
   
    if(!(iButton & IN_ATTACK2) && iMode)
    {
        remove_entity_name("rb_kobong69")
       
        if((g_iStat[id] == 1 || g_iStat[id] == 4) && g_FUCK[id] < get_gametime())
        {
            g_FUCK[id] = 0.0
            Set_WeaponAnim(id, 10)
            set_pdata_float(iEnt, 46, 0.07,4);
            set_pdata_float(iEnt, 47, 0.88,4);
            set_pdata_float(iEnt, 48, 0.88,4);
           
            set_pev(iEnt, pev_iuser3, 0)
            set_pev(iEnt, pev_iuser4, 0)
           
            g_iStat[id] = 0
        }
       
        if(g_iStat[id] == 2 || g_iStat[id] == 3)
        {
            if(g_FUCK3[id])
                remove_entity_name("rb_kobong2")
           
            set_pev(id, pev_weaponmodel2, p_model2)
            Set_WeaponAnim(id, 14)
            SendSound(id, CHAN_WEAPON, weapon_sound[9])
           
            set_pdata_float(id, 83, 0.3, 5);
            set_pdata_float(iEnt, 46, 0.86,4);
            set_pdata_float(iEnt, 47, 1.76,4);
            set_pdata_float(iEnt, 48, 0.86,4);
           
            set_pev(iEnt, pev_iuser3, 1)
            set_pev(iEnt, pev_iuser4, 0)
            set_pev(iEnt, pev_fuser4, get_gametime() + get_pdata_float(id, 83))
           
            g_iStat[id] = 4
            g_FUCK[id] = get_gametime() + 0.86
            g_FUCK2[id] = get_gametime() + 0.33
            g_FUCK3[id] = 2
           
            MakeMuzzleFlash(id, "rb_kobong", MODEL_EFSTBATT, 1, 0.3, 0.3, 1.0)
        }
    }
   
    if(!(iButton & IN_ATTACK))
    {
        if(iState && get_pdata_float(iEnt, 48, 4) <= 0.0)
        {
            set_pev(iEnt, pev_iuser1, 0)
           
            set_pdata_float(iEnt, 48, 0.86,4);
            Set_WeaponAnim(id, 5)
        }
    }
   
    if (get_pdata_float(id, 83) <= 0.0 && pev(iEnt, pev_iuser3) == 1)
    {
        if(g_iStat[id] == 1)
        {
            MakeMuzzleFlash(id, "rb_kobong", MODEL_EFSTAB, 4, 0.3, 0.01)
            MakeMuzzleFlash(id, "rb_kobong", MODEL_MFSTAB, 1, 0.2, 0.15, 0.75)
        }
       
        new iHitResult = KnifeAttack_Setting(id, 0, STAB_RANGE, STAB_ANGLE, STAB_DAMAGE, STAB_KNOCKBACK)
        switch (iHitResult)
        {
            case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
            case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
        }
        set_pev(iEnt, pev_iuser3, 0)
    }
   
    if(get_pdata_float(iEnt, 46, 4) > 0.0)
        return HAM_IGNORED
   
    if(iButton & IN_ATTACK)
    {
        set_pev(id, pev_weaponmodel2, p_model)
        set_pev(iEnt, pev_iuser2, 0)
       
        if(g_SASKEHAttack[id] && g_SASKEHAttTimer[id] < get_gametime())
        {
            g_SASKEHAttMod[id] = random_num(1, 4)
            remove_entity_name("saskeeeehhh")
       
            new Float:origin[3], Float:angles[3];
            pev(id, pev_origin, origin)
            pev(id, pev_angles, angles)
            Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, g_SASKEHAttMod[id], 0.0, 1, 255.0, 0, 0, 0.0, 0.0, g_SASKEHAttMod[id] - 1)
           
            SendSound2(id, summoner_sounds[2 + g_SASKEHAttMod[id]])
            set_pev(iEnt, pev_fuser3, get_gametime() + 0.3)
           
            g_SASKEHAttTimer[id] = get_gametime() + 1.0
            g_SASKEHTimer[id] = get_gametime() + 1.35
        }
       
        if(g_iCheck[id] == 3 && g_SASKEHAmmo[id] == 100)
        {
            g_iCheck[id] = 0
            g_SASKEHAttack[id] = 1
            Set_WeaponAnim(id, 15)
            Stock_ScreenFade(id,0,155,255, 40)
           
            set_pdata_float(iEnt, 46, 1.3,4);
            set_pdata_float(iEnt, 47, 1.5,4);
            set_pdata_float(iEnt, 48, 1.35,4);
           
            remove_entity_name("saskeeeehhh")
            g_SASKEHTimer[id] = get_gametime() + 2.86
            g_SASKEHAttTimer[id] = get_gametime() + 2.85
            SendSound2(id, summoner_sounds[1])
           
            new Float:origin[3], Float:angles[3];
            pev(id, pev_origin, origin)
            pev(id, pev_angles, angles)
            Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, 6, 0.0, 1, 0.0, 0, 1)
            Summon_SASKEEHH(id, "saskeeeehhh", MODEL_EFSUMN_SMNING, origin, angles, 0, 2.7, 1, 255.0, 1, 2, 0.01)
           
            new Float:origin2[3]
            Stock_Get_Postion(id, 0.0, 0.0, 50.0, origin2)
            Summon_SASKEEHH(id, "efx_saskeeeehhh", MODEL_EFSUMN_SMNING1, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 0.5, 0.3)
            Summon_SASKEEHH(id, "efx_saskeeeehhh", MODEL_EFSUMN_SMNING2, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 1.0, 0.5)
           
            KnifeAttack_Setting(id, true, 160.0, 180.0, 0.0, 50.0)
            return HAM_SUPERCEDE
        }
       
        switch(iState)
        {
            case 0,1:
            {
                Stock_SetPlayerAnim(id, "shoot_knife")
               
                set_pdata_float(iEnt, 46, 0.16,4);
                set_pdata_float(iEnt, 47, 0.16,4);
                set_pdata_float(iEnt, 48, 0.53,4);
       
                set_pev(iEnt, pev_iuser1, 2)
                Set_WeaponAnim(id, 1)
                SendSound(id, CHAN_WEAPON, weapon_sound[0])
               
                new iHitResult = KnifeAttack_Setting(id, 0, SLASH_RANGE, SLASH_ANGLE, SLASH_DAMAGE, 0.0)
                switch (iHitResult)
                {
                    case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
                    case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
                }
               
                if(!g_iCheck[id]) g_iCheck[id] = 1
                else g_iCheck[id] = 0
            }
            case 2:
            {
                Stock_SetPlayerAnim(id, "shoot_knife")
               
                set_pdata_float(iEnt, 46, 0.4,4);
                set_pdata_float(iEnt, 47, 0.4,4);
                set_pdata_float(iEnt, 48, 0.53,4);
       
                set_pev(iEnt, pev_iuser1, 3)
                Set_WeaponAnim(id, 2)
                SendSound(id, CHAN_WEAPON, weapon_sound[1])
               
                new iHitResult = KnifeAttack_Setting(id, 0, SLASH_RANGE, SLASH_ANGLE, SLASH_DAMAGE, 0.0)
                switch (iHitResult)
                {
                    case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
                    case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
                }
            }
            case 3:
            {
                Stock_SetPlayerAnim(id, "shoot_knife")
               
                set_pdata_float(iEnt, 46, 0.4,4);
                set_pdata_float(iEnt, 47, 0.4,4);
                set_pdata_float(iEnt, 48, 0.53,4);
       
                set_pev(iEnt, pev_iuser1, 1)
               
                if(!random_num(0,1))
                {
                    Set_WeaponAnim(id, 3)
                    SendSound(id, CHAN_WEAPON, weapon_sound[2])
                    MakeMuzzleFlash(id, "rb_kobong", MODEL_FLAME, 1, 0.3, 0.01)
                } else {
                    Set_WeaponAnim(id, 4)
                    SendSound(id, CHAN_WEAPON, weapon_sound[3])
                    MakeMuzzleFlash(id, "rb_kobong", MODEL_FLAME2, 1, 0.3, 0.01, 0.75)
                }
               
                new iHitResult = KnifeAttack_Setting(id, 0, SLASH_RANGE, SLASH_ANGLE, SLASH_DAMAGE, 0.0)
                switch (iHitResult)
                {
                    case RESULT_HIT_PLAYER : SendSound(id, CHAN_VOICE, weapon_sound[random_num(5,6)])
                    case RESULT_HIT_WORLD : SendSound(id, CHAN_VOICE, weapon_sound[7])
                }
            }
        }
    }
   
    if(iButton & IN_ATTACK2)
    {
        set_pev(iEnt, pev_iuser1, 0)
        set_pev(iEnt, pev_iuser2, 1)
        set_pev(iEnt, pev_iuser4, 0)
       
        if(g_SASKEHAttack[id] && g_SASKEHAttTimer[id] < get_gametime())
        {
            remove_entity_name("saskeeeehhh")
            g_SASKEHAttMod[id] = 5
           
            new Float:origin[3], Float:angles[3];
            pev(id, pev_origin, origin)
            pev(id, pev_angles, angles)
            Summon_SASKEEHH(id, "saskeeeehhh", SUMMONER_MDL, origin, angles, 5, 0.0, 1, 255.0)
           
            SendSound(id, CHAN_WEAPON, summoner_sounds[7])
            set_pev(iEnt, pev_fuser3, get_gametime() + 0.66)
           
            g_SASKEHAttTimer[id] = get_gametime() + 0.72
            g_SASKEHTimer[id] = get_gametime() + 2.03
        }
       
        switch (iState2)
        {
            case 0:
            {
                Stock_SetPlayerAnim(id, "shoot_knife")
                set_pev(id, pev_weaponmodel2, p_model2)
               
                SendSound(id, CHAN_WEAPON, weapon_sound[4])
                Set_WeaponAnim(id, iMode ? 9 : 8)
                set_pdata_float(id, 83, 0.3, 5);
               
                set_pev(iEnt, pev_iuser3, 1)
                set_pev(iEnt, pev_iuser4, 1)
                set_pev(iEnt, pev_fuser4, get_gametime() + get_pdata_float(id, 83))
               
                g_iStat[id] = 1
                g_FUCK[id] = get_gametime() + 0.68
               
                if(g_iCheck[id] == 1) g_iCheck[id] = 2
                else if(g_iCheck[id] == 2) g_iCheck[id] = 3
                else g_iCheck[id] = 0
               
                set_pdata_float(iEnt, 46, 0.88,4);
                set_pdata_float(iEnt, 47, 1.0,4);
                set_pdata_float(iEnt, 48, 0.88,4);
            }
            case 1:
            {
                g_FUCK[id] = get_gametime() + 0.1
                g_FUCK2[id] = get_gametime() + 0.66
                g_FUCK3[id] = 1
               
                Set_WeaponAnim(id, 12)
                Stock_SetPlayerAnim(id, "aim_knife")
                set_pev(id, pev_weaponmodel2, p_model3)
               
                set_pdata_float(iEnt, 46, 1.16,4);
                set_pdata_float(iEnt, 47, 1.53,4);
                set_pdata_float(iEnt, 48, 1.33,4);
               
                set_pev(iEnt, pev_iuser4, 2)
            }
            case 2:
            {
                g_iStat[id] = 2
                set_pev(iEnt, pev_iuser4, 3)
               
                set_pdata_float(iEnt, 46, 0.37,4);
                set_pdata_float(iEnt, 47, 1.37,4);
                set_pdata_float(iEnt, 48, 0.37,4);
               
                if(g_FUCK3[id] != 3)
                {
                    g_FUCK3[id] = 3
                    g_FUCK2[id] = get_gametime() + 0.1
                }
            }
            case 3:
            {
                g_iStat[id] = 3
                set_pev(iEnt, pev_iuser4, 3)
               
                set_pdata_float(iEnt, 46, 1.33,4);
                set_pdata_float(iEnt, 47, 1.53,4);
                set_pdata_float(iEnt, 48, 1.33,4);
               
                Set_WeaponAnim(id, 13)
                SendSound(id, CHAN_WEAPON, weapon_sound[8])
            }
        }
    }
   
    iButton &= ~IN_ATTACK;
    iButton &= ~IN_ATTACK2;
    set_pev(id, pev_button, iButton);
    return HAM_IGNORED
}
 
stock Summon_SASKEEHH(id, classname[], mdl[], Float:origin[3], Float:angles[3], seq, Float:fLife = 0.0, iRender=0, Float:fRender = 255.0, iDrop=0, stat=0, Float:fScales=0.0, Float:fFrmRate=0.0, iSlash=-1)
{
    new pEnt2 = Stock_CreateEntityBase(id, "info_target", MOVETYPE_FOLLOW, mdl, classname, SOLID_NOT, origin, 0.1)
    set_pev(pEnt2, pev_gravity, 0.1);
    set_pev(pEnt2, pev_angles, angles);
    if(fScales > 0.0) set_pev(pEnt2, pev_scale, fScales);
    engfunc(EngFunc_SetSize, pEnt2, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0})
    set_pev(pEnt2, pev_frame, 0.0)
    set_pev(pEnt2, pev_animtime, get_gametime())
    set_pev(pEnt2, pev_framerate, 1.0)
    set_pev(pEnt2, pev_sequence, seq)
    set_pev(pEnt2, pev_iuser1, stat)
    if(fLife > 0.0) set_pev(pEnt2, pev_ltime, get_gametime() + fLife)
    if(iRender)
    {
        set_pev(pEnt2, pev_rendermode, kRenderTransAdd)
        set_pev(pEnt2, pev_renderamt, fRender)
    }
    if(fFrmRate > 0.0) set_pev(pEnt2, pev_fuser1, fFrmRate)
    if(iDrop) engfunc(EngFunc_DropToFloor, pEnt2)
   
    if(iSlash != -1) SASKEH_Slash(id, pEnt2, origin, angles, iSlash, 0.5, 0.25)
}
 
stock SASKEH_Slash(id, iEnt, Float:origin[3], Float:angles[3], seq, Float:fLife = 0.0, Float:fScales=0.0)
{
    new pEnt2 = Stock_CreateEntityBase(id, "info_target", MOVETYPE_FOLLOW, MODEL_EFSUMN_SWING, "saskeh_slashefx", SOLID_NOT, origin, 0.1)
    set_pev(pEnt2, pev_gravity, 0.1);
    set_pev(pEnt2, pev_angles, angles);
    set_pev(pEnt2, pev_scale, fScales);
    engfunc(EngFunc_SetSize, pEnt2, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0})
    set_pev(pEnt2, pev_frame, 0.0)
    set_pev(pEnt2, pev_animtime, get_gametime())
    set_pev(pEnt2, pev_framerate, 1.0)
    set_pev(pEnt2, pev_sequence, seq)
    set_pev(pEnt2, pev_iuser1, iEnt)
    set_pev(pEnt2, pev_ltime, get_gametime() + fLife)
    set_pev(pEnt2, pev_rendermode, kRenderTransAdd)
    set_pev(pEnt2, pev_renderamt, 255.0)
}
 
public Fw_AddToFullPack_Post(esState, iE, iEnt, iHost, iHostFlags, iPlayer, pSet)
{
    if (!pev_valid(iEnt))
        return;
    if (pev(iEnt, pev_flags) & FL_KILLME)
        return;
 
    new Classname[32];
    pev(iEnt, pev_classname, Classname, 31);
 
    if(equal(Classname, "rb_kobong") || equal(Classname, "rb_kobong2") || equal(Classname, "rb_kobong69"))
    {
        if (iHost != pev(iEnt, pev_owner))
            set_es(esState, ES_Effects, (get_es(esState, ES_Effects) | EF_NODRAW));
    }
}
 
public fw_MF_Think(iEnt)
{
    if(!pev_valid(iEnt))
        return
   
    static Classname[32], iOwner, iStat
    pev(iEnt, pev_classname, Classname, sizeof(Classname))
    iOwner = pev(iEnt, pev_owner)
    iStat = pev(iEnt, pev_iuser1)
   
    if(equal(Classname, "saskeh_slashefx"))
    {
        set_pev(iEnt, pev_movetype, MOVETYPE_FLY)
        set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)
       
        new Float:origin[3],Float:fOrigin[3], Float:vecAngle[3], iAttach
        iAttach = pev(iEnt, pev_iuser1)
       
        if(!pev_valid(iAttach))
        {
            engfunc(EngFunc_RemoveEntity, iEnt)
            return
        }
       
        pev(iEnt, pev_origin, fOrigin)
        pev(iAttach, pev_origin, origin)
        pev(iAttach, pev_v_angle, vecAngle);
       
        vecAngle[0] = 0.0;
        set_pev(iEnt, pev_v_angle, vecAngle);
        set_pev(iEnt, pev_angles, vecAngle);
 
        static Float:fSpeed
        fSpeed = floatmin(500.0, vector_distance(origin, fOrigin) * 9.0)
        Stock_Hook_Ent(iEnt, origin, fSpeed, 1)
       
        if(pev(iEnt, pev_ltime) < get_gametime() || get_user_weapon(iOwner) != CSW_RUNEBLADE)
        {
            new Float:fRender
            pev(iEnt, pev_renderamt, fRender)
           
            fRender -= 25.0
            set_pev(iEnt, pev_renderamt, fRender)
           
            if(!fRender)
            {
                engfunc(EngFunc_RemoveEntity, iEnt)
                return
            }
        }
    }
   
    if(equal(Classname, "saskeeeehhh") || equal(Classname, "efx_saskeeeehhh"))
    {
        set_pev(iEnt, pev_movetype, MOVETYPE_FLY)
        set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)
       
        new Float:origin[3],Float:fOrigin[3], Float:vecAngle[3]
        pev(iEnt, pev_origin, fOrigin)
        pev(iOwner, pev_origin, origin)
        pev(iOwner, pev_v_angle, vecAngle);
       
        if(equal(Classname, "efx_saskeeeehhh"))
            origin[2] += 50.0
       
        vecAngle[0] = 0.0;
        set_pev(iEnt, pev_v_angle, vecAngle);
        set_pev(iEnt, pev_angles, vecAngle);
 
        static Float:fSpeed
        fSpeed = floatmin(500.0, vector_distance(origin, fOrigin) * 9.0)
        Stock_Hook_Ent(iEnt, origin, fSpeed, 1)
 
        if(equal(Classname, "efx_saskeeeehhh"))
        {
            new Float:fFrameRate, Float:fFrame, Float:fFrameMax;
            pev(iEnt, pev_frame, fFrame)
            pev(iEnt, pev_fuser1, fFrameRate)
            fFrameMax = float(engfunc(EngFunc_ModelFrames, pev(iEnt,pev_modelindex)))
            fFrame += fFrameRate
           
            if(fFrame >= fFrameMax)
            {
                set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME)
                return
            }
            set_pev(iEnt, pev_frame, fFrame)
        } else {
            if(iStat == 1)
            {
                new Float:fRender
                pev(iEnt, pev_renderamt, fRender)
               
                fRender += 1.0
                set_pev(iEnt, pev_renderamt, fRender)
            }
           
            if(!iStat && (!g_SASKEHAmmo[iOwner] || get_user_weapon(iOwner) != CSW_RUNEBLADE))
            {
                new Float:fRender
                pev(iEnt, pev_renderamt, fRender)
               
                fRender -= 5.0
                set_pev(iEnt, pev_renderamt, fRender)
               
                if(fRender == 175.0)
                {
                    g_SASKEHAttack[iOwner] = 0
                    g_SASKEHAttMod[iOwner] = 0
                    engfunc(EngFunc_RemoveEntity, iEnt)
                   
                    new Float:origin2[3], Float:angles[3]
                    pev(iOwner, pev_origin, origin2)
                    pev(iOwner, pev_angles, angles)
                    Summon_SASKEEHH(iOwner, "saskeeeehhh", SUMMONER_MDL, origin2, angles, 7, 1.0, 1, 175.0, 0, 3)
           
                    Stock_Get_Postion(iOwner, 0.0, 0.0, 50.0, origin2)
                    Summon_SASKEEHH(iOwner, "efx_saskeeeehhh", MODEL_EFSUMN_UNSMNING1, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 0.5, 0.3)
                    Summon_SASKEEHH(iOwner, "efx_saskeeeehhh", MODEL_EFSUMN_UNSMNING2, origin2, angles, 0, 0.0, 1, 255.0, 0, 0, 0.5, 0.5)
                   
                    SendSound2(iOwner, summoner_sounds[0])
                    Stock_ScreenFade(iOwner,0,155,255, 40)
                    return
                }
            }
           
            if(iStat > 1 && (pev(iEnt, pev_ltime) < get_gametime() || get_user_weapon(iOwner) != CSW_RUNEBLADE))
            {
                if(iStat == 2)
                {
                    engfunc(EngFunc_RemoveEntity, iEnt)
                    return
                }
               
                new Float:fRender
                pev(iEnt, pev_renderamt, fRender)
               
                fRender -= 5.0
                set_pev(iEnt, pev_renderamt, fRender)
               
                if(!fRender)
                {
                    if(iStat == 3)
                    {
                        g_SASKEHAmmo[iOwner] = 0
                        Stock_ScreenFade(iOwner)
                    }
                    engfunc(EngFunc_RemoveEntity, iEnt)
                    return
                }
            }
        }
    }
   
    if(equal(Classname, "rb_kobong") || equal(Classname, "rb_kobong69"))
    {
        new Float:fFrameRate, Float:fFrame, Float:fFrameMax;
        pev(iEnt, pev_frame, fFrame)
        pev(iEnt, pev_fuser1, fFrameRate)
        fFrameMax = float(engfunc(EngFunc_ModelFrames, pev(iEnt,pev_modelindex)))
 
        fFrame += fFrameRate
        set_pev(iEnt, pev_frame, fFrame)
        set_pev(iEnt, pev_nextthink, 0.01);
       
        if (fFrame >= fFrameMax || get_user_weapon(iOwner) != CSW_RUNEBLADE)
        {
            set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME);
            return;
        }
        return
    }
   
    if(equal(Classname, "rb_kobong2"))
    {
        new Float:fFrameRate, Float:fFrame, Float:fFrameMax
        pev(iEnt, pev_frame, fFrame)
        pev(iEnt, pev_fuser1, fFrameRate)
        fFrameMax = float(engfunc(EngFunc_ModelFrames, pev(iEnt,pev_modelindex)))
       
        fFrame += fFrameRate
        if(fFrame >= fFrameMax)
            fFrame = 0.0
       
        set_pev(iEnt, pev_frame, fFrame)
        set_pev(iEnt, pev_nextthink, get_gametime() + 0.035)
        return
    }
   
    if(equal(Classname, "DN_Cannon"))
    {
        static iOwner;
        iOwner = pev(iEnt, pev_owner)
        if(entity_range(iEnt, iOwner) > 750.0)
        {
            Explosions(iEnt, iOwner)
            set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME)
            return;
        }
        set_pev(iEnt, pev_nextthink, get_gametime() + 0.01)
    }
}
 
public fw_MF_Touch(iEnt,iPtd)
{
    if(!pev_valid(iEnt))
        return HAM_IGNORED
   
    static Classname[32]
    pev(iEnt, pev_classname, Classname, sizeof(Classname))
   
    if(!equal(Classname, "DN_Cannon"))
        return HAM_IGNORED
       
    new iOwner, Float:vecOri[3]
    iOwner = pev(iEnt, pev_owner)
    pev(iEnt, pev_origin, vecOri)
   
    if(iPtd == iOwner)
        return HAM_IGNORED
   
    new Float:fOrigin[3]
    pev(iEnt, pev_origin, fOrigin)
 
    Explosions(iEnt, iOwner)
    engfunc(EngFunc_RemoveEntity, iEnt)
    return HAM_IGNORED
}
 
public Explosions(iPtr, iOwner)
{
    new Float:fOrigin[3]
    pev(iPtr, pev_origin, fOrigin)
   
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0)
    write_byte(TE_EXPLOSION)
    engfunc(EngFunc_WriteCoord, fOrigin[0])
    engfunc(EngFunc_WriteCoord, fOrigin[1])
    engfunc(EngFunc_WriteCoord, fOrigin[2])
    write_short(g_Exp_SprId)
    write_byte(7)
    write_byte(40)
    write_byte(TE_EXPLFLAG_NODLIGHTS | TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND)
    message_end()
   
    SendSound(iPtr, CHAN_VOICE, "weapons/plasmagun_exp.wav")
   
    new pEntity = -1
    while((pEntity = engfunc(EngFunc_FindEntityInSphere, pEntity, fOrigin, CHARGE_RANGE)) != 0)
    {
        if(pev(pEntity, pev_takedamage) == DAMAGE_NO) continue
        if(is_user_connected(pEntity) && pEntity != iOwner)
            if(!can_damage(pEntity, iOwner)) continue
        if(pEntity == iOwner) continue
       
        if(pev_valid(pEntity))
        {
            ExecuteHamB(Ham_TakeDamage, pEntity, iOwner, iOwner, CHARGE_DAMAGE, DMG_BULLET)
               
            Stock_Fake_KnockBack(iOwner, pEntity, CHARGE_KNOCKBACK)
            if(is_user_alive(pEntity)) SpawnBlood(fOrigin, get_pdata_int(pEntity,89), floatround(CHARGE_DAMAGE/5.0))
        }
    }
}
stock MakeMuzzleFlash(id, class[], model[], iBody, Float:fScale, Float:fNext, Float:fFrameRate = 1.0, iCheck = 0)
{
    new Float:fOrigin[3]
    pev(id, pev_origin, fOrigin)
   
    static iMuz
    iMuz = Stock_CreateEntityBase(id, "env_sprite", MOVETYPE_FOLLOW, model, class, SOLID_NOT,fOrigin,fNext)
    set_pev(iMuz, pev_body, iBody)
    set_pev(iMuz, pev_rendermode, kRenderTransAdd)
    set_pev(iMuz, pev_renderamt, 255.0)
    set_pev(iMuz, pev_aiment, id)
    set_pev(iMuz, pev_scale, fScale)
    set_pev(iMuz, pev_frame, 0.0)
    set_pev(iMuz, pev_fuser1, fFrameRate)
    if(iCheck)
    {
        set_pev(iMuz, pev_animtime, get_gametime())
        set_pev(iMuz, pev_framerate, 1.0)
    }
    dllfunc(DLLFunc_Spawn, iMuz)
}
 
public DN_Shoot_Cannon(id)
{
    static Float:vAvel[3],Float:targetOri[3], Float:vAngle[3], Float:vVelocity[3],Float:fOrigin2[3], Float:vPlayerVelocity[3];
    pev(id, pev_origin, fOrigin2)
    pev(id, pev_v_angle, vAngle)
    pev(id, pev_velocity, vPlayerVelocity);
    fm_get_aim_origin(id, targetOri)
   
    Stock_GetSpeedVector(fOrigin2, targetOri, 1550.0, vVelocity);
    xs_vec_add(vVelocity, vPlayerVelocity, vVelocity);
   
    vector_to_angle(vVelocity, vAngle)
    if(vAngle[0] > 90.0) vAngle[0] = -(360.0 - vAngle[0]);
   
    new iFlame = Stock_CreateEntityBase(id, "info_target", MOVETYPE_FLY, model_cannon, "DN_Cannon", SOLID_BBOX, fOrigin2, 0.01)
    set_pev(iFlame, pev_animtime, get_gametime())
    set_pev(iFlame, pev_framerate, 1.0)
    set_pev(iFlame ,pev_angles, vAngle)    
    set_pev(iFlame, pev_frame, 1.0)
    set_pev(iFlame, pev_scale, 1.5)
    set_pev(iFlame, pev_rendermode, kRenderTransAdd)
    set_pev(iFlame, pev_renderamt, 255.0)
    engfunc(EngFunc_SetSize, iFlame, {1.0,1.0,1.0}, {1.0,1.0,1.0})
   
    vAvel[2] = random_float(-200.0, 200.0)
    set_pev(iFlame, pev_avelocity, vAvel)
    set_pev(iFlame, pev_velocity, vVelocity)
}
 
stock Stock_CreateEntityBase(id, classtype[], mvtyp, mdl[], class[], solid, Float:fOrigin[3], Float:fNext)
{
    new pEntity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, classtype))
    set_pev(pEntity, pev_movetype, mvtyp);
    set_pev(pEntity, pev_owner, id);
    engfunc(EngFunc_SetModel, pEntity, mdl);
    set_pev(pEntity, pev_classname, class);
    set_pev(pEntity, pev_solid, solid);
    set_pev(pEntity, pev_origin, fOrigin);
    set_pev(pEntity, pev_nextthink, get_gametime() + fNext)
    return pEntity
}
 
stock Stock_ScreenFade(id,r=200,g=200,b=200,br=0)
{
    if(!is_user_alive(id))
        return
       
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, id)
    write_short((1<<12))//duration
    write_short((1<<12) * 1) //Hold
    write_short(0x0004) //Type
    write_byte(r) //R
    write_byte(g) //G
    write_byte(b) //B
    write_byte(br) //B
    message_end()
}
 
stock SendSound(id, chan, sample[]) emit_sound(id, chan, sample, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
stock SendSound2(id, iSound[])
{
    if(!is_user_alive(id))
        return
       
    client_cmd(id, "spk %s", iSound)
}
 
stock KnifeAttack_Setting(id, bStab, Float:flRange, Float:fAngle, Float:flDamage, Float:flKnockBack)
{
    new iHitResult
    if(fAngle > 0.0) iHitResult = KnifeAttack2(id, bStab, Float:flRange, Float:fAngle, Float:flDamage, Float:flKnockBack)
    else iHitResult = KnifeAttack(id, bStab, Float:flRange, Float:flDamage, Float:flKnockBack)
 
    return iHitResult
}
 
stock KnifeAttack(id, bStab, Float:flRange, Float:flDamage, Float:flKnockBack, iHitgroup = -1, bitsDamageType = DMG_NEVERGIB | DMG_CLUB)
{
    new Float:vecSrc[3], Float:vecEnd[3], Float:v_angle[3], Float:vecForward[3];
    GetGunPosition(id, vecSrc);
 
    pev(id, pev_v_angle, v_angle);
    engfunc(EngFunc_MakeVectors, v_angle);
 
    global_get(glb_v_forward, vecForward);
    xs_vec_mul_scalar(vecForward, flRange, vecForward);
    xs_vec_add(vecSrc, vecForward, vecEnd);
 
    new tr = create_tr2();
    engfunc(EngFunc_TraceLine, vecSrc, vecEnd, 0, id, tr);
 
    new Float:flFraction; get_tr2(tr, TR_flFraction, flFraction);
    if (flFraction >= 1.0) engfunc(EngFunc_TraceHull, vecSrc, vecEnd, 0, 3, id, tr);
   
    get_tr2(tr, TR_flFraction, flFraction);
 
    new Float:EndPos2[3]
    get_tr2(tr, TR_vecEndPos, EndPos2)
   
    new iHitResult = RESULT_HIT_NONE;
   
    if (flFraction < 1.0)
    {
        iHitResult = RESULT_HIT_WORLD;
       
        new pEntity = get_tr2(tr, TR_pHit);
        if (pev_valid(pEntity) && (IsPlayer(pEntity) || IsHostage(pEntity)))
        {
            if (CheckBack(id, pEntity) && bStab && iHitgroup == -1)
                flDamage *= 3.0;
           
            iHitResult = RESULT_HIT_PLAYER;
        }
 
        if (pev_valid(pEntity))
        {
            engfunc(EngFunc_MakeVectors, v_angle);
            global_get(glb_v_forward, vecForward);
 
            if (iHitgroup != -1)
                set_tr2(tr, TR_iHitgroup, iHitgroup);
 
            OrpheuCall(OrpheuGetFunction("ClearMultiDamage"))
            ExecuteHamB(Ham_TraceAttack, pEntity, id, flDamage, vecForward, tr, bitsDamageType);
            OrpheuCall(OrpheuGetFunction("ApplyMultiDamage"), id, id)
           
            Stock_Fake_KnockBack(id, pEntity, flKnockBack)
           
            if (IsAlive(pEntity))
            {
                free_tr2(tr);
                return iHitResult;
            }
        }
    }
    free_tr2(tr);
    return iHitResult;
}
 
stock KnifeAttack2(id, bStab, Float:flRange, Float:fAngle, Float:flDamage, Float:flKnockBack, iHitgroup = -1, bitsDamageType = DMG_NEVERGIB | DMG_CLUB, bNoTraceCheck = 0)
{
    new Float:vecOrigin[3], Float:vecSrc[3], Float:vecEnd[3], Float:v_angle[3], Float:vecForward[3];
    pev(id, pev_origin, vecOrigin);
 
    new iHitResult = RESULT_HIT_NONE;
    GetGunPosition(id, vecSrc);
 
    pev(id, pev_v_angle, v_angle);
    engfunc(EngFunc_MakeVectors, v_angle);
 
    global_get(glb_v_forward, vecForward);
    xs_vec_mul_scalar(vecForward, flRange, vecForward);
    xs_vec_add(vecSrc, vecForward, vecEnd);
 
    new tr = create_tr2();
    engfunc(EngFunc_TraceLine, vecSrc, vecEnd, 0, id, tr);
 
    new Float:flFraction;
    get_tr2(tr, TR_flFraction, flFraction);
 
    if (flFraction < 1.0) iHitResult = RESULT_HIT_WORLD;
 
    new Float:vecEndZ = vecEnd[2];
 
    new pEntity = -1;
    while ((pEntity = engfunc(EngFunc_FindEntityInSphere, pEntity, vecOrigin, flRange)) != 0)
    {
        if (!pev_valid(pEntity))
            continue;
        if (id == pEntity)
            continue;
        if (!IsAlive(pEntity))
            continue;
        if (!CheckAngle(id, pEntity, fAngle))
            continue;
 
        GetGunPosition(id, vecSrc);
        Stock_Get_Origin(pEntity, vecEnd);
 
        vecEnd[2] = vecSrc[2] + (vecEndZ - vecSrc[2]) * (get_distance_f(vecSrc, vecEnd) / flRange);
 
        xs_vec_sub(vecEnd, vecSrc, vecForward);
        xs_vec_normalize(vecForward, vecForward);
        xs_vec_mul_scalar(vecForward, flRange, vecForward);
        xs_vec_add(vecSrc, vecForward, vecEnd);
 
        engfunc(EngFunc_TraceLine, vecSrc, vecEnd, 0, id, tr);
        get_tr2(tr, TR_flFraction, flFraction);
 
        if (flFraction >= 1.0) engfunc(EngFunc_TraceHull, vecSrc, vecEnd, 0, 3, id, tr);
        get_tr2(tr, TR_flFraction, flFraction);
 
        if (flFraction < 1.0)
        {
            if (IsPlayer(pEntity) || IsHostage(pEntity))
            {
                iHitResult = RESULT_HIT_PLAYER;
 
                if (CheckBack(id, pEntity) && bStab && iHitgroup == -1)
                    flDamage *= 3.0;
            }
 
            if (get_tr2(tr, TR_pHit) == pEntity || bNoTraceCheck)
            {
                engfunc(EngFunc_MakeVectors, v_angle);
                global_get(glb_v_forward, vecForward);
 
                if (iHitgroup != -1) set_tr2(tr, TR_iHitgroup, iHitgroup);
 
                OrpheuCall(OrpheuGetFunction("ClearMultiDamage"))
                ExecuteHamB(Ham_TraceAttack, pEntity, id, flDamage, vecForward, tr, bitsDamageType);
                OrpheuCall(OrpheuGetFunction("ApplyMultiDamage"), id, id)
 
                Stock_Fake_KnockBack(id, pEntity, flKnockBack)
            }
        }
        free_tr2(tr);
    }
    return iHitResult;
}
 
stock Set_WeaponAnim(id, anim)
{
    set_pev(id, pev_weaponanim, anim)
   
    message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id)
    write_byte(anim)
    write_byte(pev(id, pev_body))
    message_end()
}
 
stock Stock_SetPlayerAnim(id, const AnimName[], Float:rate=1.0)
{
    static AnimNum, Float:FrameRate, Float:GroundSpeed, bool:Loops, Anim2[64]
    if(!(pev(id, pev_flags) & FL_DUCKING)) format(Anim2, 63, "ref_%s", AnimName)
    else format(Anim2, 63, "crouch_%s", AnimName)
 
    if ((AnimNum=lookup_sequence(id,Anim2,FrameRate,Loops,GroundSpeed))==-1) AnimNum=0
   
    if (!Loops || (Loops && pev(id,pev_sequence)!=AnimNum))
    {
        set_pev(id, pev_gaitsequence, AnimNum)
        set_pev(id, pev_sequence, AnimNum)
        set_pev(id, pev_frame, 0.0)
        set_pev(id, pev_animtime, get_gametime())
    }
    set_pev(id, pev_framerate, rate)
 
    set_pdata_int(id, 40, Loops, 4)
    set_pdata_int(id, 39, 0, 4)
 
    set_pdata_float(id, 36, FrameRate, 4)
    set_pdata_float(id, 37, GroundSpeed, 4)
    set_pdata_float(id, 38, get_gametime(), 4)
 
    set_pdata_int(id, 73, 28, 5)
    set_pdata_int(id, 74, 28, 5)
    set_pdata_float(id, 220, get_gametime(), 5)
}
 
stock Set_PlayerNextAttack(id, Float:nexttime)
{
    set_pdata_float(id, 83, nexttime, 5)
}
 
stock Make_EffSprite(Float:fOrigin[3],bStab)
{
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0)
    write_byte(TE_EXPLOSION)
    engfunc(EngFunc_WriteCoord, fOrigin[0])
    engfunc(EngFunc_WriteCoord, fOrigin[1])
    engfunc(EngFunc_WriteCoord, fOrigin[2])
    write_short(bStab?spr1:spr2)
    write_byte(bStab?6:3)
    write_byte(40)
    write_byte(TE_EXPLFLAG_NODLIGHTS | TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND)
    message_end()
}
 
stock Make_EffSprite2(Float:fOrigin[3])
{
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0)
    write_byte(TE_EXPLOSION)
    engfunc(EngFunc_WriteCoord, fOrigin[0])
    engfunc(EngFunc_WriteCoord, fOrigin[1])
    engfunc(EngFunc_WriteCoord, fOrigin[2])
    write_short(spr3)
    write_byte(2)
    write_byte(48)
    write_byte(TE_EXPLFLAG_NODLIGHTS | TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND)
    message_end()
}
 
stock Stock_Get_Postion(id,Float:forw,Float:right,Float:up,Float:vStart[])
{
    static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
    pev(id, pev_origin, vOrigin)
    pev(id, pev_view_ofs,vUp)
    xs_vec_add(vOrigin,vUp,vOrigin)
    pev(id, pev_v_angle, vAngle)
   
    engfunc(EngFunc_AngleVectors, vAngle, vForward, vRight, vUp)
   
    vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up
    vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up
    vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up
}
 
stock IsPlayer(pEntity) return is_user_connected(pEntity)
 
stock IsHostage(pEntity)
{
    new classname[32]; pev(pEntity, pev_classname, classname, charsmax(classname))
    return equal(classname, "hostage_entity")
}
 
stock IsAlive(pEntity)
{
    if (pEntity < 1) return 0
    return (pev(pEntity, pev_deadflag) == DEAD_NO && pev(pEntity, pev_health) > 0)
}
 
stock GetGunPosition(id, Float:vecScr[3])
{
    new Float:vecViewOfs[3]
    pev(id, pev_origin, vecScr)
    pev(id, pev_view_ofs, vecViewOfs)
    xs_vec_add(vecScr, vecViewOfs, vecScr)
}
 
stock CheckBack(iEnemy,id)
{
    new Float:anglea[3], Float:anglev[3]
    pev(iEnemy, pev_v_angle, anglea)
    pev(id, pev_v_angle, anglev)
    new Float:angle = anglea[1] - anglev[1]
    if (angle < -180.0) angle += 360.0
    if (angle <= 45.0 && angle >= -45.0) return 1
    return 0
}
 
stock CheckAngle(iAttacker, iVictim, Float:fAngle)  return(Stock_CheckAngle(iAttacker, iVictim) > floatcos(fAngle,degrees))
 
stock Float:Stock_CheckAngle(id,iTarget)
{
    new Float:vOricross[2],Float:fRad,Float:vId_ori[3],Float:vTar_ori[3],Float:vId_ang[3],Float:fLength,Float:vForward[3]
    Stock_Get_Origin(id, vId_ori)
    Stock_Get_Origin(iTarget, vTar_ori)
   
    pev(id,pev_angles,vId_ang)
    for(new i=0;i<2;i++) vOricross[i] = vTar_ori[i] - vId_ori[i]
   
    fLength = floatsqroot(vOricross[0]*vOricross[0] + vOricross[1]*vOricross[1])
   
    if (fLength<=0.0)
    {
        vOricross[0]=0.0
        vOricross[1]=0.0
    } else {
        vOricross[0]=vOricross[0]*(1.0/fLength)
        vOricross[1]=vOricross[1]*(1.0/fLength)
    }
   
    engfunc(EngFunc_MakeVectors,vId_ang)
    global_get(glb_v_forward,vForward)
   
    fRad = vOricross[0]*vForward[0]+vOricross[1]*vForward[1]
   
    return fRad   //->   RAD 90' = 0.5rad
}
 
stock Stock_Get_Origin(id, Float:origin[3])
{
    new Float:maxs[3],Float:mins[3]
    if (pev(id, pev_solid) == SOLID_BSP)
    {
        pev(id,pev_maxs,maxs)
        pev(id,pev_mins,mins)
        origin[0] = (maxs[0] - mins[0]) / 2 + mins[0]
        origin[1] = (maxs[1] - mins[1]) / 2 + mins[1]
        origin[2] = (maxs[2] - mins[2]) / 2 + mins[2]
    } else pev(id, pev_origin, origin)
}
 
stock Stock_GetSpeedVector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
    xs_vec_sub(origin2, origin1, new_velocity)
    new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
    xs_vec_mul_scalar(new_velocity, num, new_velocity)
}
 
stock SpawnBlood(const Float:vecOrigin[3], iColor, iAmount)
{
    if(iAmount == 0)
        return
 
    if (!iColor)
        return
 
    iAmount *= 2
    if(iAmount > 255) iAmount = 255
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, vecOrigin)
    write_byte(TE_BLOODSPRITE)
    engfunc(EngFunc_WriteCoord, vecOrigin[0])
    engfunc(EngFunc_WriteCoord, vecOrigin[1])
    engfunc(EngFunc_WriteCoord, vecOrigin[2])
    write_short(spr_blood_spray)
    write_short(spr_blood_drop)
    write_byte(iColor)
    write_byte(min(max(3, iAmount / 10), 16))
    message_end()
}
 
public Stock_Fake_KnockBack(id, iVic, Float:iKb)
{
    if(iVic > 32) return
   
    new Float:vAttacker[3], Float:vVictim[3], Float:vVelocity[3], flags
    pev(id, pev_origin, vAttacker)
    pev(iVic, pev_origin, vVictim)
    vAttacker[2] = vVictim[2] = 0.0
    flags = pev(id, pev_flags)
   
    xs_vec_sub(vVictim, vAttacker, vVictim)
    new Float:fDistance
    fDistance = xs_vec_len(vVictim)
    xs_vec_mul_scalar(vVictim, 1 / fDistance, vVictim)
   
    pev(iVic, pev_velocity, vVelocity)
    xs_vec_mul_scalar(vVictim, iKb, vVictim)
    xs_vec_mul_scalar(vVictim, 50.0, vVictim)
    vVictim[2] = xs_vec_len(vVictim) * 0.15
   
    if(flags &~ FL_ONGROUND)
    {
        xs_vec_mul_scalar(vVictim, 1.2, vVictim)
        vVictim[2] *= 0.4
    }
    if(xs_vec_len(vVictim) > xs_vec_len(vVelocity)) set_pev(iVic, pev_velocity, vVictim)
}  
 
stock Float:Stock_Get_Body_Dmg(iBody)
{
    switch (iBody)
    {
        case HIT_GENERIC: return 0.75
        case 1: return 4.0
        case 2: return 1.0
        case 3: return 1.25
        case 4,5,6,7: return 0.75
        default: return 0.75
    }
    return 1.0
}
 
stock Stock_BloodEffect(Float:vecOri[3], scale)
{
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    write_byte(TE_BLOODSPRITE)
    engfunc(EngFunc_WriteCoord,vecOri[0])
    engfunc(EngFunc_WriteCoord,vecOri[1])
    engfunc(EngFunc_WriteCoord,vecOri[2])
    write_short(spr_blood_spray)
    write_short(spr_blood_drop)
    write_byte(75)
    write_byte(scale)
    message_end()
}
stock can_damage(id1, id2)
{
    if(id1 <= 0 || id1 >= 33 || id2 <= 0 || id2 >= 33)
        return 1
       
    // Check team
    return(get_pdata_int(id1, 114) != get_pdata_int(id2, 114))
}
///////
stock Stock_Hook_Ent(ent, Float:TargetOrigin[3], Float:Speed, mode=0)
{
    static Float:fl_Velocity[3],Float:EntOrigin[3],Float:distance_f,Float:fl_Time
    pev(ent, pev_origin, EntOrigin)
   
    if(!mode)
    {
        distance_f = get_distance_f(EntOrigin, TargetOrigin)
        fl_Time = distance_f / Speed
           
        pev(ent, pev_velocity, fl_Velocity)
           
        fl_Velocity[0] = (TargetOrigin[0] - EntOrigin[0]) / fl_Time
        fl_Velocity[1] = (TargetOrigin[1] - EntOrigin[1]) / fl_Time
        fl_Velocity[2] = (TargetOrigin[2] - EntOrigin[2]) / fl_Time
 
        if(vector_length(fl_Velocity) > 1.0) set_pev(ent, pev_velocity, fl_Velocity)
        else set_pev(ent, pev_velocity, Float:{0.01, 0.01, 0.01})
    } else {
        static Float:fl_EntVelocity[3], Float:fl_Acc[3]
        Stock_Directed_Vector(TargetOrigin, EntOrigin, fl_Velocity)
        xs_vec_mul_scalar(fl_Velocity, Speed, fl_Velocity)
       
        for(new i =0; i<3; i++)
        {
            if(fl_Velocity[i] > fl_EntVelocity[i])
            {
                fl_Acc[i] = fl_Velocity[i]-fl_EntVelocity[i]
                fl_Acc[i] = floatmin(70.0, fl_Acc[i])
                fl_EntVelocity[i] += fl_Acc[i]
            }
            else if(fl_Velocity[i] < fl_EntVelocity[i])
            {
                fl_Acc[i] = fl_EntVelocity[i]-fl_Velocity[i]
                fl_Acc[i] = floatmin(70.0, fl_Acc[i])
                fl_EntVelocity[i] -= fl_Acc[i]
            }
        }
        set_pev(ent, pev_velocity, fl_EntVelocity)
    }
}
 
stock Stock_Directed_Vector(Float:start[3],Float:end[3],Float:reOri[3])
{  
    new Float:v3[3]
    v3[0]=start[0]-end[0]
    v3[1]=start[1]-end[1]
    v3[2]=start[2]-end[2]
    new Float:vl = vector_length(v3)
    reOri[0] = v3[0] / vl
    reOri[1] = v3[1] / vl
    reOri[2] = v3[2] / vl
}
[Learning HTML coding language]
[Learning Unreal Engine 4]
[Learning Adobe programs]

Mystic Viper
Senior Member
Senior Member
Romania
Posts: 106
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

#3

Post by Mystic Viper » 3 Months Ago

Orpheu not working with REHLDS

User avatar
Muhammet20
Veteran Member
Veteran Member
Turkey
Posts: 408
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 15
Contact:

#4

Post by Muhammet20 » 3 Months Ago

i wasn't know XD, am sorry i don't know how to convert plugins from an module to another
[Learning HTML coding language]
[Learning Unreal Engine 4]
[Learning Adobe programs]

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests