Gulliton As Knife

Unpaid Requests, Public Plugins
Post Reply
VicKy
Mod Tester
Mod Tester
Pakistan
Posts: 82
Joined: 1 Year Ago
Has thanked: 14 times
Been thanked: 11 times
Age: 19
Contact:

Gulliton As Knife

#1

Post by VicKy » 1 Month Ago

Can Anyone Convert THis Into Knife? Please i tried but that was bugged so here is without bug code
  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <fakemeta_util>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. #define PLUGIN "Blood-Dripper"
  8. #define VERSION "1.0"
  9. #define AUTHOR "m4m3ts"
  10.  
  11. #define CSW_BDRIPPER CSW_MAC10
  12. #define weapon_guillotine "weapon_mac10"
  13. #define old_event "events/mac10.sc"
  14. #define old_w_model "models/w_mac10.mdl"
  15. #define WEAPON_SECRETCODE 1329419
  16.  
  17.  
  18. #define DEFAULT_AMMO 10
  19. #define DAMAGE 50
  20. #define BDRIP_CLASSNAME "Blood Dripper"
  21. #define WEAPON_ANIMEXT "knife"
  22.  
  23. #define Get_Ent_Data(%1,%2) get_pdata_int(%1,%2,4)
  24. #define Set_Ent_Data(%1,%2,%3) set_pdata_int(%1,%2,%3,4)
  25.  
  26. const PDATA_SAFE = 2
  27. const OFFSET_LINUX_WEAPONS = 4
  28. const OFFSET_WEAPONOWNER = 41
  29.  
  30. new const v_model[] = "models/FuriX/v_guillotine_furix_v3.mdl"
  31. new const p_model[] = "models/zombie_escape/p_guillotine.mdl"
  32. new const w_model[] = "models/zombie_escape/w_guillotine.mdl"
  33. new const KNIFE_MODEL[] = "models/zombie_escape/guillotine_projectile.mdl"
  34. new const PECAH_MODEL[] = "models/zombie_escape/gibs_guilotine.mdl"
  35. new const hit_wall[] = "weapons/janus9_stone1.wav"
  36. new const hit_wall2[] = "weapons/janus9_stone2.wav"
  37. new const weapon_sound[6][] =
  38. {
  39.     "weapons/guillotine_catch2.wav",
  40.     "weapons/guillotine_draw.wav",
  41.     "weapons/guillotine_draw_empty.wav",
  42.     "weapons/guillotine_explode.wav",
  43.     "weapons/guillotine_red.wav",
  44.     "weapons/guillotine-1.wav"
  45. }
  46.  
  47.  
  48. new const WeaponResource[3][] =
  49. {
  50.     "sprites/weapon_guillotine.txt",
  51.     "sprites/640hud120.spr",
  52.     "sprites/guillotine_lost.spr"
  53. }
  54.  
  55. enum
  56. {
  57.     ANIM_IDLE = 0,
  58.     ANIM_IDLE_EMPTY,
  59.     ANIM_SHOOT,
  60.     ANIM_DRAW,
  61.     ANIM_DRAW_EMPTY,
  62.     ANIM_IDLE_SHOOT,
  63.     ANIM_IDLE_SHOOT2,
  64.     ANIM_CATCH,
  65.     ANIM_LOST
  66. }
  67.  
  68. new g_MsgDeathMsg
  69.  
  70. new g_had_guillotine[33], g_guillotine_ammo[33], shoot_mode[33], shoot_ent_mode[33], g_pecah, headshot_mode[33], ent_sentuh[33], ent_sentuh_balik[33]
  71. new g_old_weapon[33], g_smokepuff_id, m_iBlood[2], guillotine_korban[33], headshot_korban[33], gmsgScoreInfo
  72. new g_iItemID
  73.  
  74. const PRIMARY_WEAPONS_BIT_SUM =
  75. (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
  76. CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
  77.  
  78. public plugin_init()
  79. {
  80.     register_plugin(PLUGIN, VERSION, AUTHOR)
  81.     register_cvar("guillotine_version", "m4m3ts", FCVAR_SERVER|FCVAR_SPONLY)
  82.     register_forward(FM_CmdStart, "fw_CmdStart")
  83.     register_forward(FM_SetModel, "fw_SetModel")
  84.     register_think(BDRIP_CLASSNAME, "fw_Think")
  85.     register_touch(BDRIP_CLASSNAME, "*", "fw_touch")
  86.     register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
  87.     register_forward(FM_TraceLine, "fw_traceline", 1)
  88.     register_forward(FM_AddToFullPack, "fm_addtofullpack_post", 1)
  89.     RegisterHam(Ham_Weapon_WeaponIdle, weapon_guillotine, "fw_guillotineidleanim", 1)
  90.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  91.     RegisterHam(Ham_Item_AddToPlayer, weapon_guillotine, "fw_AddToPlayer_Post", 1)
  92.     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  93.    
  94.    
  95.     register_clcmd("weapon_guillotine", "hook_weapon")
  96.     g_iItemID = ze_register_item("Gulliton", 250, 1)
  97.     ze_set_item_vip(g_iItemID, "VIP_F")
  98.  
  99.    
  100.     g_MsgDeathMsg = get_user_msgid("DeathMsg")
  101.     gmsgScoreInfo = get_user_msgid("ScoreInfo")
  102. }
  103.  
  104.  
  105. public plugin_precache()
  106. {
  107.     precache_model(v_model)
  108.     precache_model(p_model)
  109.     precache_model(w_model)
  110.     precache_model(KNIFE_MODEL)
  111.     g_pecah = precache_model(PECAH_MODEL)
  112.     precache_sound(hit_wall)
  113.     precache_sound(hit_wall2)
  114.    
  115.     for(new i = 0; i < sizeof(weapon_sound); i++)
  116.         precache_sound(weapon_sound[i])
  117.    
  118.     for(new i = 1; i < sizeof(WeaponResource); i++)
  119.         precache_model(WeaponResource[i])
  120.    
  121.     g_smokepuff_id = engfunc(EngFunc_PrecacheModel, WeaponResource[2])
  122.     m_iBlood[0] = precache_model("sprites/blood.spr")
  123.     m_iBlood[1] = precache_model("sprites/bloodspray.spr")
  124. }
  125.  
  126. public plugin_natives()
  127. {
  128.     register_native("has_guillotine", "native_has_guillotine", 1)
  129.     register_native("give_guillotine", "native_give_guillotine", 1)
  130.     register_native("remove_guillotine", "native_remove_guillotine", 1)
  131. }
  132.  
  133. public native_has_guillotine(id)
  134. {
  135.     return g_had_guillotine[id]
  136. }
  137.  
  138. public native_give_guillotine(id)
  139. {
  140.     get_guillotine(id)
  141. }
  142.  
  143. public native_remove_guillotine(id)
  144. {
  145.     remove_guillotine(id)
  146. }
  147.  
  148. public ze_user_infected(id)
  149. {
  150.     remove_guillotine(id)
  151. }
  152.  
  153. public fw_PlayerKilled(id)
  154. {
  155.     remove_guillotine(id)
  156. }
  157.  
  158. public hook_weapon(id)
  159. {
  160.     engclient_cmd(id, weapon_guillotine)
  161.     return
  162. }
  163.  
  164. public ze_select_item_pre(id, itemid)
  165. {
  166.     // This not our item?
  167.     if (itemid != g_iItemID)
  168.         return ZE_ITEM_AVAILABLE
  169.    
  170.     // Available for Humans only, So don't show it for zombies
  171.     if (ze_is_user_zombie(id))
  172.         return ZE_ITEM_DONT_SHOW
  173.    
  174.     // Finally return that it's available
  175.     return ZE_ITEM_AVAILABLE
  176. }
  177.  
  178. public ze_select_item_post(id, itemid)
  179. {
  180.     // This is not our item, Block it here and don't execute the blew code
  181.     if (itemid != g_iItemID)
  182.         return
  183.    
  184.     get_guillotine(id)
  185. }
  186.  
  187. public get_guillotine(id)
  188. {
  189.     if(!is_user_alive(id))
  190.         return
  191.     drop_weapons(id, 1)
  192.     g_had_guillotine[id] = 1
  193.     g_guillotine_ammo[id] = DEFAULT_AMMO
  194.    
  195.     give_item(id, weapon_guillotine)
  196.     update_ammo(id)
  197.    
  198.     static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_guillotine, id)
  199.     if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  200. }
  201.  
  202. public remove_guillotine(id)
  203. {
  204.     g_had_guillotine[id] = 0
  205. }
  206.  
  207. public refill_guillotine(id)
  208. {  
  209.     if(g_had_guillotine[id]) g_guillotine_ammo[id] = 15
  210.    
  211.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id]) update_ammo(id)
  212. }
  213.    
  214. public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
  215. {
  216.     if(!is_user_alive(id) || !is_user_connected(id))
  217.         return FMRES_IGNORED  
  218.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  219.         set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001)
  220.    
  221.     return FMRES_HANDLED
  222. }
  223.  
  224. public Event_CurWeapon(id)
  225. {
  226.     if(!is_user_alive(id))
  227.         return
  228.        
  229.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  230.     {
  231.         set_pev(id, pev_viewmodel2, v_model)
  232.         set_pev(id, pev_weaponmodel2, p_model)
  233.         set_pdata_string(id, 492 * 4, WEAPON_ANIMEXT, -1 , 20)
  234.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] >= 1) set_weapon_anim(id, ANIM_DRAW)
  235.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] == 0) set_weapon_anim(id, ANIM_DRAW_EMPTY)
  236.         update_ammo(id)
  237.     }
  238.    
  239.     g_old_weapon[id] = get_user_weapon(id)
  240. }
  241.  
  242. public fw_guillotineidleanim(knife)
  243. {
  244.     new id = get_pdata_cbase(knife, 41, 4)
  245.  
  246.     if(!is_user_alive(id) || ze_is_user_zombie(id) || !g_had_guillotine[id] || get_user_weapon(id) != CSW_BDRIPPER)
  247.         return HAM_IGNORED;
  248.    
  249.     if(shoot_mode[id] == 0 && g_guillotine_ammo[id] >= 1)
  250.         return HAM_SUPERCEDE;
  251.    
  252.     if(headshot_mode[id] == 0 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  253.     {
  254.         set_weapon_anim(id, ANIM_IDLE_SHOOT)
  255.         set_pdata_float(knife, 48, 20.0, 4)
  256.         return HAM_SUPERCEDE;
  257.     }
  258.    
  259.     if(headshot_mode[id] == 1 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  260.     {
  261.         set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  262.         set_pdata_float(knife, 48, 20.0, 4)
  263.         return HAM_SUPERCEDE;
  264.     }
  265.    
  266.     if(g_guillotine_ammo[id] == 0 && get_pdata_float(knife, 48, 4) <= 0.25)
  267.     {
  268.         set_weapon_anim(id, ANIM_IDLE_EMPTY)
  269.         set_pdata_float(knife, 48, 20.0, 4)
  270.         return HAM_SUPERCEDE;
  271.     }
  272.  
  273.     return HAM_IGNORED;
  274. }
  275.  
  276. public fw_CmdStart(id, uc_handle, seed)
  277. {
  278.     if(!is_user_alive(id) || !is_user_connected(id))
  279.         return
  280.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  281.         return
  282.    
  283.     static ent; ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  284.     if(!pev_valid(ent))
  285.         return
  286.     if(get_pdata_float(ent, 46, OFFSET_LINUX_WEAPONS) > 0.0 || get_pdata_float(ent, 47, OFFSET_LINUX_WEAPONS) > 0.0)
  287.         return
  288.    
  289.     static CurButton
  290.     CurButton = get_uc(uc_handle, UC_Buttons)
  291.    
  292.     if(CurButton & IN_ATTACK)
  293.     {
  294.         CurButton &= ~IN_ATTACK
  295.         set_uc(uc_handle, UC_Buttons, CurButton)
  296.        
  297.         if(g_guillotine_ammo[id] == 0)
  298.             return
  299.         if(shoot_mode[id] == 0 && get_pdata_float(id, 83, 5) <= 0.0)
  300.         {
  301.             g_guillotine_ammo[id]--
  302.             update_ammo(id)
  303.             shoot_mode[id] = 1
  304.             FireKnife(id)
  305.             set_weapon_anim(id, ANIM_SHOOT)
  306.             emit_sound(id, CHAN_WEAPON, weapon_sound[5], 1.0, ATTN_NORM, 0, PITCH_NORM)
  307.             set_weapons_timeidle(id, CSW_BDRIPPER, 0.7)
  308.             set_player_nextattackx(id, 0.7)
  309.         }
  310.     }
  311. }
  312.  
  313. public FireKnife(id)
  314. {
  315.     static Float:StartOrigin[3], Float:velocity[3], Float:angles[3], Float:anglestrue[3], Float:jarak_max[3]
  316.     get_position(id, 2.0, 0.0, 0.0, StartOrigin)
  317.     get_position(id, 700.0, 0.0, 0.0, jarak_max)
  318.    
  319.     pev(id,pev_v_angle,angles)
  320.     static Ent; Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  321.     if(!pev_valid(Ent)) return
  322.     anglestrue[0] = 360.0 - angles[0]
  323.     anglestrue[1] = angles[1]
  324.     anglestrue[2] = angles[2]
  325.    
  326.     // Set info for ent
  327.     set_pev(Ent, pev_movetype, MOVETYPE_FLY)
  328.     set_pev(Ent, pev_owner, id)
  329.     set_pev(Ent, pev_iuser1, id)
  330.     set_pev(Ent, pev_fuser1, get_gametime() + 4.0)
  331.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  332.    
  333.     entity_set_string(Ent, EV_SZ_classname, BDRIP_CLASSNAME)
  334.     engfunc(EngFunc_SetModel, Ent, KNIFE_MODEL)
  335.     set_pev(Ent, pev_mins, Float:{-1.0, -1.0, -1.0})
  336.     set_pev(Ent, pev_maxs, Float:{1.0, 1.0, 1.0})
  337.     set_pev(Ent, pev_origin, StartOrigin)
  338.     set_pev(Ent, pev_angles, anglestrue)
  339.     set_pev(Ent, pev_gravity, 0.01)
  340.     set_pev(Ent, pev_solid, SOLID_BBOX)
  341.     set_pev(Ent, pev_frame, 1.0)
  342.     set_pev(Ent, pev_framerate, 30.0)
  343.     set_pev(Ent, pev_sequence, 0)
  344.    
  345.     velocity_by_aim( id, 1100, velocity )
  346.     set_pev( Ent, pev_velocity, velocity )
  347.     set_pev(Ent, pev_vuser1, velocity)
  348.     set_pev(Ent, pev_vuser2, jarak_max)
  349.     shoot_ent_mode[id] = 0
  350.     ent_sentuh[id] = 1
  351.     ent_sentuh_balik[id] = 0
  352. }
  353.  
  354. public fm_addtofullpack_post(es, e, user, host, host_flags, player, p_set)
  355. {
  356.     if(!player)
  357.         return FMRES_IGNORED
  358.        
  359.     if(!is_user_connected(host) || !is_user_alive(user))
  360.         return FMRES_IGNORED
  361.        
  362.     if(!ze_is_user_zombie(user) || headshot_korban[user] != 1)
  363.         return FMRES_IGNORED
  364.        
  365.     if(host == user)
  366.         return FMRES_IGNORED
  367.    
  368.     new Float:PlayerOrigin[3], Float:anglesss[3]
  369.     pev(user, pev_origin, PlayerOrigin)
  370.    
  371.     engfunc(EngFunc_GetBonePosition, user, 8, PlayerOrigin, anglesss)
  372.                        
  373.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  374.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  375.  
  376.     return FMRES_HANDLED
  377. }
  378.  
  379. public fw_Think(Ent)
  380. {
  381.     if(!pev_valid(Ent))
  382.         return
  383.    
  384.     static Float:pulang[3], Float:StartOriginz[3], pemilix, Float:brangkat[3], Float:jarak_max[3], Float:origin_asli[3], korban
  385.     pemilix = pev(Ent, pev_iuser1)
  386.     pev(Ent, pev_origin, StartOriginz)
  387.     korban = pev(Ent, pev_iuser2)
  388.    
  389.     if(headshot_korban[korban] == 1)
  390.     {
  391.         if(get_gametime() - 0.2 > pev(Ent, pev_fuser3))
  392.         {
  393.             Damage_guillotine(Ent, korban)
  394.             set_pev(Ent, pev_fuser3, get_gametime())
  395.         }
  396.     }
  397.    
  398.     if(ent_sentuh_balik[pemilix] == 0 && shoot_ent_mode[pemilix] == 1)
  399.     {
  400.         ent_sentuh_balik[pemilix] = 1
  401.         pev(pemilix, pev_origin, origin_asli)
  402.         origin_asli[2] += 7.5
  403.     }
  404.    
  405.     if(ent_sentuh[pemilix] == 1)
  406.     {
  407.         ent_sentuh[pemilix] = 0
  408.         pev(Ent, pev_vuser2, jarak_max)
  409.         pev(Ent, pev_vuser1, brangkat)
  410.         get_speed_vector(StartOriginz, origin_asli, 1100.0, pulang)
  411.                    
  412.         if(shoot_ent_mode[pemilix] == 1)
  413.         {
  414.             set_pev(Ent, pev_velocity, pulang)
  415.         }
  416.         else set_pev(Ent, pev_velocity, brangkat)
  417.     }
  418.    
  419.     if(shoot_ent_mode[pemilix] == 0 && get_distance_f(StartOriginz, jarak_max) <= 10.0)
  420.     {
  421.         shoot_ent_mode[pemilix] = 1
  422.         ent_sentuh[pemilix] = 1
  423.         set_pev(Ent, pev_owner, 0)
  424.     }
  425.    
  426.     if(shoot_ent_mode[pemilix] == 1 && get_distance_f(StartOriginz, origin_asli) <= 10.0)
  427.     {
  428.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  429.         else ancur(Ent)
  430.     }
  431.     else if(headshot_korban[korban] == 1) set_pev(Ent, pev_nextthink, get_gametime() + 0.2)
  432.     else set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  433. }
  434.  
  435. public fw_touch(Ent, Id)
  436. {
  437.     // If ent is valid
  438.     if(!pev_valid(Ent))
  439.         return
  440.     if(pev(Ent, pev_movetype) == MOVETYPE_NONE)
  441.         return
  442.     static classnameptd[32]
  443.     pev(Id, pev_classname, classnameptd, 31)
  444.     if (equali(classnameptd, "func_breakable")) ExecuteHamB( Ham_TakeDamage, Id, 0, 0, 80.0, DMG_GENERIC )
  445.    
  446.     // Get it's origin
  447.     new Float:originF[3], pemilix
  448.     pemilix = pev(Ent, pev_iuser1)
  449.     pev(Ent, pev_origin, originF)
  450.     // Alive...
  451.    
  452.     if(is_user_alive(Id) && ze_is_user_zombie(Id))
  453.     {
  454.         Damage_guillotine(Ent, Id)
  455.         set_pev(Ent, pev_owner, Id)
  456.         ent_sentuh[pemilix] = 1
  457.         create_blood(originF)
  458.         create_blood(originF)
  459.     }
  460.    
  461.     else if(shoot_ent_mode[pemilix] == 1 && Id == pemilix)
  462.     {
  463.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  464.         else ancur(Ent)
  465.     }
  466.    
  467.     else if(is_user_alive(Id) && !ze_is_user_zombie(Id))
  468.     {
  469.         set_pev(Ent, pev_owner, Id)
  470.         ent_sentuh[pemilix] = 1
  471.     }
  472.    
  473.     else
  474.     {
  475.         set_pev(Ent, pev_owner, 0)
  476.  
  477.         if(shoot_ent_mode[pemilix] == 0)
  478.         {
  479.             shoot_ent_mode[pemilix] = 1
  480.             engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  481.             ent_sentuh[pemilix] = 1
  482.         }
  483.         else ancur(Ent)
  484.     }
  485. }
  486.  
  487. public ancur(Ent)
  488. {
  489.     if(!pev_valid(Ent))
  490.         return
  491.     static Float:origin2[3], pemilix, Float:origin3[3]
  492.     pemilix = pev(Ent, pev_iuser1)
  493.     entity_get_vector(Ent, EV_VEC_origin, origin2)
  494.     pev(Ent, pev_origin, origin3)
  495.    
  496.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin2, 0)
  497.     write_byte(TE_BREAKMODEL)
  498.     engfunc(EngFunc_WriteCoord, origin2[0])
  499.     engfunc(EngFunc_WriteCoord, origin2[1])
  500.     engfunc(EngFunc_WriteCoord, origin2[2])
  501.     engfunc(EngFunc_WriteCoord, 25)
  502.     engfunc(EngFunc_WriteCoord, 25)
  503.     engfunc(EngFunc_WriteCoord, 25)
  504.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  505.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  506.     engfunc(EngFunc_WriteCoord, 5)
  507.     write_byte(5)
  508.     write_short(g_pecah)
  509.     write_byte(10)
  510.     write_byte(17)
  511.     write_byte(0x00)
  512.     message_end()
  513.    
  514.     fake_smokes(origin3)
  515.     engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall2, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  516.     shoot_mode[pemilix] = 0
  517.     remove_entity(Ent)
  518.    
  519.     if(!is_user_alive(pemilix) || !is_user_connected(pemilix) || get_user_weapon(pemilix) != CSW_BDRIPPER || !g_had_guillotine[pemilix])
  520.         return
  521.    
  522.     set_weapon_anim(pemilix, ANIM_LOST)
  523.     set_weapons_timeidle(pemilix, CSW_BDRIPPER, 2.5)
  524.     set_player_nextattackx(pemilix, 2.5)
  525.     set_task(1.3, "reload2", pemilix)
  526.     set_task(1.4, "reload", pemilix)
  527. }
  528.  
  529. public reload(id)
  530. {
  531.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  532.         return
  533.    
  534.     set_weapon_anim(id, ANIM_DRAW)
  535. }
  536.  
  537. public reload2(id)
  538. {
  539.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  540.         return
  541.    
  542.     set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  543. }
  544.  
  545. public balik(Ent)
  546. {
  547.     if(!pev_valid(Ent))
  548.         return
  549.     static id
  550.     id = pev(Ent, pev_iuser1)
  551.     set_weapon_anim(id, ANIM_CATCH)
  552.     emit_sound(id, CHAN_WEAPON, weapon_sound[0], 1.0, ATTN_NORM, 0, PITCH_NORM)
  553.     set_weapons_timeidle(id, CSW_BDRIPPER, 1.0)
  554.     set_player_nextattackx(id, 1.0)
  555.     shoot_mode[id] = 0
  556.     g_guillotine_ammo[id]++
  557.     update_ammo(id)
  558.    
  559.     remove_entity(Ent)
  560. }
  561.  
  562. public Damage_guillotine(Ent, Id)
  563. {
  564.     static Owner; Owner = pev(Ent, pev_iuser1)
  565.     static Attacker;
  566.     if(!is_user_alive(Owner))
  567.     {
  568.         Attacker = 0
  569.         return
  570.     } else Attacker = Owner
  571.  
  572.     new bool:bIsHeadShot; // never make that one static
  573.     new Float:flAdjustedDamage, bool:death
  574.        
  575.     switch( Get_MissileWeaponHitGroup(Ent) )
  576.     {
  577.         case HIT_GENERIC: flAdjustedDamage = DAMAGE * 1.0
  578.         case HIT_STOMACH: flAdjustedDamage = DAMAGE * 1.2
  579.         case HIT_LEFTLEG, HIT_RIGHTLEG: flAdjustedDamage = DAMAGE * 1.0
  580.         case HIT_LEFTARM, HIT_RIGHTARM: flAdjustedDamage = DAMAGE * 1.0
  581.         case HIT_HEAD, HIT_CHEST:
  582.         {
  583.             flAdjustedDamage = DAMAGE * 3.0
  584.             bIsHeadShot = true
  585.             if(headshot_mode[Owner] == 0) set_task(2.0, "balik_bro", Ent+1858941 )
  586.             headshot_mode[Owner] = 1
  587.             headshot_korban[Id] = 1
  588.             guillotine_korban[Id] = Ent
  589.             set_pev(Ent, pev_iuser2, Id)
  590.             set_pev(Ent, pev_sequence, 1)
  591.             set_pev(Ent, pev_solid, SOLID_NOT)
  592.             set_pev(Ent, pev_fuser3, 0.0)
  593.         }
  594.     }
  595.     if(pev(Id, pev_health) <= flAdjustedDamage) death = true
  596.    
  597.     if(is_user_alive(Id))
  598.     {
  599.         if( bIsHeadShot && death)
  600.         {
  601.             if(task_exists( Ent+1858941 )) remove_task( Ent + 1858941 )
  602.             set_pev(Ent, pev_sequence, 0)
  603.             headshot_korban[pev(Ent, pev_iuser2)] = 0
  604.             headshot_mode[Owner] = 0
  605.             shoot_ent_mode[Owner] = 1
  606.             ent_sentuh[Owner] = 1
  607.             ent_sentuh_balik[Owner] = 0
  608.             set_pev(Ent, pev_solid, SOLID_BBOX)
  609.             set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  610.    
  611.             kill(Attacker, Id, 1)
  612.            
  613.             death = false          
  614.         }
  615.         if(death)
  616.         {
  617.             kill(Attacker, Id, 0)
  618.            
  619.             death = false          
  620.         }
  621.         else ExecuteHamB(Ham_TakeDamage, Id, Ent, Attacker, flAdjustedDamage, DMG_BULLET)
  622.     }
  623. }
  624.  
  625. public balik_bro(Ent)
  626. {
  627.     Ent -= 1858941
  628.    
  629.     if(!pev_valid(Ent))
  630.         return
  631.    
  632.     static pemilix; pemilix = pev(Ent, pev_iuser1)
  633.     set_pev(Ent, pev_sequence, 0)
  634.     headshot_korban[pev(Ent, pev_iuser2)] = 0
  635.     headshot_mode[pemilix] = 0
  636.     shoot_ent_mode[pemilix] = 1
  637.     ent_sentuh[pemilix] = 1
  638.     ent_sentuh_balik[pemilix] = 0
  639.     set_pev(Ent, pev_solid, SOLID_BBOX)
  640.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  641. }
  642.  
  643. public fw_SetModel(entity, model[])
  644. {
  645.     if(!pev_valid(entity))
  646.         return FMRES_IGNORED
  647.    
  648.     static Classname[64]
  649.     pev(entity, pev_classname, Classname, sizeof(Classname))
  650.    
  651.     if(!equal(Classname, "weaponbox"))
  652.         return FMRES_IGNORED
  653.    
  654.     static id
  655.     id = pev(entity, pev_owner)
  656.    
  657.     if(equal(model, old_w_model))
  658.     {
  659.         static weapon
  660.         weapon = fm_get_user_weapon_entity(entity, CSW_BDRIPPER)
  661.        
  662.         if(!pev_valid(weapon))
  663.             return FMRES_IGNORED
  664.        
  665.         if(g_had_guillotine[id])
  666.         {
  667.             set_pev(weapon, pev_impulse, WEAPON_SECRETCODE)
  668.             set_pev(weapon, pev_iuser4, g_guillotine_ammo[id])
  669.             engfunc(EngFunc_SetModel, entity, w_model)
  670.            
  671.             g_had_guillotine[id] = 0
  672.             g_guillotine_ammo[id] = 0
  673.            
  674.             return FMRES_SUPERCEDE
  675.         }
  676.     }
  677.  
  678.     return FMRES_IGNORED;
  679. }
  680.  
  681. public fw_AddToPlayer_Post(ent, id)
  682. {
  683.     if(pev(ent, pev_impulse) == WEAPON_SECRETCODE)
  684.     {
  685.         g_had_guillotine[id] = 1
  686.         g_guillotine_ammo[id] = pev(ent, pev_iuser4)
  687.        
  688.         set_pev(ent, pev_impulse, 0)
  689.     }          
  690.    
  691.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
  692.     write_string((g_had_guillotine[id] == 1 ? "weapon_guillotine" : "weapon_mac10"))
  693.     write_byte(6)
  694.     write_byte(100)
  695.     write_byte(-1)
  696.     write_byte(-1)
  697.     write_byte(0)
  698.     write_byte(13)
  699.     write_byte(CSW_BDRIPPER)
  700.     write_byte(0)
  701.     message_end()
  702. }
  703.  
  704. public update_ammo(id)
  705. {
  706.     if(!is_user_alive(id))
  707.         return
  708.  
  709.     static weapon_ent; weapon_ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  710.     if(!pev_valid(weapon_ent)) return
  711.    
  712.     cs_set_weapon_ammo(weapon_ent, g_guillotine_ammo[id])  
  713.     cs_set_user_bpammo(id, CSW_BDRIPPER, g_guillotine_ammo[id])
  714.    
  715.     engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, get_user_msgid("CurWeapon"), {0, 0, 0}, id)
  716.     write_byte(1)
  717.     write_byte(CSW_BDRIPPER)
  718.     write_byte(-1)
  719.     message_end()
  720.    
  721.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("AmmoX"), _, id)
  722.     write_byte(1)
  723.     write_byte(g_guillotine_ammo[id])
  724.     message_end()
  725. }
  726.  
  727. public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id,ptr)
  728. {
  729.     if(!is_user_alive(id))
  730.         return HAM_IGNORED
  731.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  732.         return HAM_IGNORED
  733.  
  734.     // get crosshair aim
  735.     static Float:aim[3];
  736.     get_aim(id,v1,aim);
  737.    
  738.     // do another trace to this spot
  739.     new trace = create_tr2();
  740.     engfunc(EngFunc_TraceLine,v1,aim,noMonsters,id,trace);
  741.    
  742.     // copy ints
  743.     set_tr2(ptr,TR_AllSolid,get_tr2(trace,TR_AllSolid));
  744.     set_tr2(ptr,TR_StartSolid,get_tr2(trace,TR_StartSolid));
  745.     set_tr2(ptr,TR_InOpen,get_tr2(trace,TR_InOpen));
  746.     set_tr2(ptr,TR_InWater,get_tr2(trace,TR_InWater));
  747.     set_tr2(ptr,TR_pHit,get_tr2(trace,TR_pHit));
  748.     set_tr2(ptr,TR_iHitgroup,get_tr2(trace,TR_iHitgroup));
  749.  
  750.     // copy floats
  751.     get_tr2(trace,TR_flFraction,aim[0]);
  752.     set_tr2(ptr,TR_flFraction,aim[0]);
  753.     get_tr2(trace,TR_flPlaneDist,aim[0]);
  754.     set_tr2(ptr,TR_flPlaneDist,aim[0]);
  755.    
  756.     // copy vecs
  757.     get_tr2(trace,TR_vecEndPos,aim);
  758.     set_tr2(ptr,TR_vecEndPos,aim);
  759.     get_tr2(trace,TR_vecPlaneNormal,aim);
  760.     set_tr2(ptr,TR_vecPlaneNormal,aim);
  761.  
  762.     // get rid of new trace
  763.     free_tr2(trace);
  764.  
  765.     return FMRES_IGNORED;
  766. }
  767.  
  768. get_aim(id,Float:source[3],Float:ret[3])
  769. {
  770.     static Float:vAngle[3], Float:pAngle[3], Float:dir[3], Float:temp[3];
  771.  
  772.     // get aiming direction from forward global based on view angle and punch angle
  773.     pev(id,pev_v_angle,vAngle);
  774.     pev(id,pev_punchangle,pAngle);
  775.     xs_vec_add(vAngle,pAngle,temp);
  776.     engfunc(EngFunc_MakeVectors,temp);
  777.     global_get(glb_v_forward,dir);
  778.    
  779.     /* vecEnd = vecSrc + vecDir * flDistance; */
  780.     xs_vec_mul_scalar(dir,8192.0,temp);
  781.     xs_vec_add(source,temp,ret);
  782. }
  783.  
  784. public fake_smokes(Float:Origin[3])
  785. {
  786.     static TE_FLAG
  787.    
  788.     TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
  789.     TE_FLAG |= TE_EXPLFLAG_NOSOUND
  790.     TE_FLAG |= TE_EXPLFLAG_NOPARTICLES
  791.    
  792.     engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, Origin, 0)
  793.     write_byte(TE_EXPLOSION)
  794.     engfunc(EngFunc_WriteCoord, Origin[0])
  795.     engfunc(EngFunc_WriteCoord, Origin[1])
  796.     engfunc(EngFunc_WriteCoord, Origin[2])
  797.     write_short(g_smokepuff_id)
  798.     write_byte(6)
  799.     write_byte(25)
  800.     write_byte(TE_FLAG)
  801.     message_end()
  802. }
  803.  
  804. stock set_weapon_anim(id, anim)
  805. {
  806.     if(!is_user_alive(id))
  807.         return
  808.    
  809.     set_pev(id, pev_weaponanim, anim)
  810.    
  811.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id)
  812.     write_byte(anim)
  813.     write_byte(pev(id, pev_body))
  814.     message_end()
  815. }
  816.  
  817. stock kill(k, v, headshot)
  818. {
  819.     cs_set_user_money(k, cs_get_user_money(k) + 500)
  820.    
  821.     set_user_frags(k, get_user_frags(k) + 1)
  822.    
  823.     set_msg_block(g_MsgDeathMsg,BLOCK_ONCE)
  824.     set_msg_block(gmsgScoreInfo,BLOCK_ONCE)
  825.     user_kill(v,1)
  826.    
  827.     new kteam = get_user_team(k);
  828.     new vteam = get_user_team(v);
  829.    
  830.     new kfrags = get_user_frags(k);
  831.     new kdeaths = get_user_deaths(k);
  832.    
  833.     new vfrags = get_user_frags(v);
  834.     new vdeaths = get_user_deaths(v);
  835.    
  836.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  837.     ewrite_byte(k);
  838.     ewrite_short(kfrags);
  839.     ewrite_short(kdeaths);
  840.     ewrite_short(0);
  841.     ewrite_short(kteam);
  842.     emessage_end();
  843.    
  844.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  845.     ewrite_byte(v);
  846.     ewrite_short(vfrags);
  847.     ewrite_short(vdeaths);
  848.     ewrite_short(0);
  849.     ewrite_short(vteam);
  850.     emessage_end();
  851.    
  852.     emessage_begin(MSG_BROADCAST, g_MsgDeathMsg)
  853.     ewrite_byte(k)
  854.     ewrite_byte(v)
  855.     ewrite_byte(headshot)
  856.     ewrite_string("Blood Dripper")
  857.     emessage_end()
  858. }
  859.  
  860.  
  861. stock create_blood(const Float:origin[3])
  862. {
  863.     // Show some blood :)
  864.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  865.     write_byte(TE_BLOODSPRITE)
  866.     engfunc(EngFunc_WriteCoord, origin[0])
  867.     engfunc(EngFunc_WriteCoord, origin[1])
  868.     engfunc(EngFunc_WriteCoord, origin[2])
  869.     write_short(m_iBlood[1])
  870.     write_short(m_iBlood[0])
  871.     write_byte(75)
  872.     write_byte(8)
  873.     message_end()
  874. }
  875.  
  876. stock drop_weapons(id, dropwhat)
  877. {
  878.     static weapons[32], num, i, weaponid
  879.     num = 0
  880.     get_user_weapons(id, weapons, num)
  881.      
  882.     for (i = 0; i < num; i++)
  883.     {
  884.         weaponid = weapons[i]
  885.          
  886.         if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
  887.         {
  888.             static wname[32]
  889.             get_weaponname(weaponid, wname, sizeof wname - 1)
  890.             engclient_cmd(id, "drop", wname)
  891.         }
  892.     }
  893. }
  894.  
  895. stock Get_MissileWeaponHitGroup( iEnt )
  896. {
  897.     new Float:flStart[ 3 ], Float:flEnd[ 3 ];
  898.    
  899.     pev( iEnt, pev_origin, flStart );
  900.     pev( iEnt, pev_velocity, flEnd );
  901.     xs_vec_add( flStart, flEnd, flEnd );
  902.    
  903.     new ptr = create_tr2();
  904.     engfunc( EngFunc_TraceLine, flStart, flEnd, 0, iEnt, ptr );
  905.    
  906.     new iHitGroup, Owner, nOhead, head
  907.     Owner = pev(iEnt, pev_iuser1)
  908.     nOhead = get_tr2( ptr, TR_iHitgroup )
  909.     head = set_tr2( ptr, TR_iHitgroup, HIT_HEAD )
  910.    
  911.     iHitGroup = headshot_mode[Owner] ? head : nOhead
  912.    
  913.     free_tr2( ptr );
  914.    
  915.     return iHitGroup;
  916. }
  917.  
  918. stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
  919. {
  920.     new_velocity[0] = origin2[0] - origin1[0]
  921.     new_velocity[1] = origin2[1] - origin1[1]
  922.     new_velocity[2] = origin2[2] - origin1[2]
  923.     static Float:num; num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
  924.     new_velocity[0] *= num
  925.     new_velocity[1] *= num
  926.     new_velocity[2] *= num
  927.    
  928.     return 1;
  929. }
  930.  
  931. stock get_position(id,Float:forw, Float:right, Float:up, Float:vStart[])
  932. {
  933.     static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
  934.    
  935.     pev(id, pev_origin, vOrigin)
  936.     pev(id, pev_view_ofs, vUp) //for player
  937.     xs_vec_add(vOrigin, vUp, vOrigin)
  938.     pev(id, pev_v_angle, vAngle) // if normal entity ,use pev_angles
  939.    
  940.     angle_vector(vAngle, ANGLEVECTOR_FORWARD, vForward) //or use EngFunc_AngleVectors
  941.     angle_vector(vAngle, ANGLEVECTOR_RIGHT, vRight)
  942.     angle_vector(vAngle, ANGLEVECTOR_UP, vUp)
  943.    
  944.     vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up
  945.     vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up
  946.     vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up
  947. }
  948.  
  949. stock set_weapons_timeidle(id, WeaponId ,Float:TimeIdle)
  950. {
  951.     if(!is_user_alive(id))
  952.         return
  953.        
  954.     static entwpn; entwpn = fm_get_user_weapon_entity(id, WeaponId)
  955.     if(!pev_valid(entwpn))
  956.         return
  957.        
  958.     set_pdata_float(entwpn, 48, TimeIdle + 0.2, OFFSET_LINUX_WEAPONS)
  959. }
  960.  
  961. stock set_player_nextattackx(id, Float:nexttime)
  962. {
  963.     if(!is_user_alive(id))
  964.         return
  965.        
  966.     set_pdata_float(id, 83, nexttime, 5)
  967. }
  968.  
Image
Image

User avatar
Evillious Energy
Member
Member
Nepal
Posts: 21
Joined: 1 Year Ago
Has thanked: 3 times
Been thanked: 2 times
Contact:

#2

Post by Evillious Energy » 1 Month Ago

VicKy wrote:
1 Month Ago
Can Anyone Convert THis Into Knife? Please i tried but that was bugged so here is without bug code
  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <fakemeta_util>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. #define PLUGIN "Blood-Dripper"
  8. #define VERSION "1.0"
  9. #define AUTHOR "m4m3ts"
  10.  
  11. #define CSW_BDRIPPER CSW_MAC10
  12. #define weapon_guillotine "weapon_mac10"
  13. #define old_event "events/mac10.sc"
  14. #define old_w_model "models/w_mac10.mdl"
  15. #define WEAPON_SECRETCODE 1329419
  16.  
  17.  
  18. #define DEFAULT_AMMO 10
  19. #define DAMAGE 50
  20. #define BDRIP_CLASSNAME "Blood Dripper"
  21. #define WEAPON_ANIMEXT "knife"
  22.  
  23. #define Get_Ent_Data(%1,%2) get_pdata_int(%1,%2,4)
  24. #define Set_Ent_Data(%1,%2,%3) set_pdata_int(%1,%2,%3,4)
  25.  
  26. const PDATA_SAFE = 2
  27. const OFFSET_LINUX_WEAPONS = 4
  28. const OFFSET_WEAPONOWNER = 41
  29.  
  30. new const v_model[] = "models/FuriX/v_guillotine_furix_v3.mdl"
  31. new const p_model[] = "models/zombie_escape/p_guillotine.mdl"
  32. new const w_model[] = "models/zombie_escape/w_guillotine.mdl"
  33. new const KNIFE_MODEL[] = "models/zombie_escape/guillotine_projectile.mdl"
  34. new const PECAH_MODEL[] = "models/zombie_escape/gibs_guilotine.mdl"
  35. new const hit_wall[] = "weapons/janus9_stone1.wav"
  36. new const hit_wall2[] = "weapons/janus9_stone2.wav"
  37. new const weapon_sound[6][] =
  38. {
  39.     "weapons/guillotine_catch2.wav",
  40.     "weapons/guillotine_draw.wav",
  41.     "weapons/guillotine_draw_empty.wav",
  42.     "weapons/guillotine_explode.wav",
  43.     "weapons/guillotine_red.wav",
  44.     "weapons/guillotine-1.wav"
  45. }
  46.  
  47.  
  48. new const WeaponResource[3][] =
  49. {
  50.     "sprites/weapon_guillotine.txt",
  51.     "sprites/640hud120.spr",
  52.     "sprites/guillotine_lost.spr"
  53. }
  54.  
  55. enum
  56. {
  57.     ANIM_IDLE = 0,
  58.     ANIM_IDLE_EMPTY,
  59.     ANIM_SHOOT,
  60.     ANIM_DRAW,
  61.     ANIM_DRAW_EMPTY,
  62.     ANIM_IDLE_SHOOT,
  63.     ANIM_IDLE_SHOOT2,
  64.     ANIM_CATCH,
  65.     ANIM_LOST
  66. }
  67.  
  68. new g_MsgDeathMsg
  69.  
  70. new g_had_guillotine[33], g_guillotine_ammo[33], shoot_mode[33], shoot_ent_mode[33], g_pecah, headshot_mode[33], ent_sentuh[33], ent_sentuh_balik[33]
  71. new g_old_weapon[33], g_smokepuff_id, m_iBlood[2], guillotine_korban[33], headshot_korban[33], gmsgScoreInfo
  72. new g_iItemID
  73.  
  74. const PRIMARY_WEAPONS_BIT_SUM =
  75. (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
  76. CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
  77.  
  78. public plugin_init()
  79. {
  80.     register_plugin(PLUGIN, VERSION, AUTHOR)
  81.     register_cvar("guillotine_version", "m4m3ts", FCVAR_SERVER|FCVAR_SPONLY)
  82.     register_forward(FM_CmdStart, "fw_CmdStart")
  83.     register_forward(FM_SetModel, "fw_SetModel")
  84.     register_think(BDRIP_CLASSNAME, "fw_Think")
  85.     register_touch(BDRIP_CLASSNAME, "*", "fw_touch")
  86.     register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
  87.     register_forward(FM_TraceLine, "fw_traceline", 1)
  88.     register_forward(FM_AddToFullPack, "fm_addtofullpack_post", 1)
  89.     RegisterHam(Ham_Weapon_WeaponIdle, weapon_guillotine, "fw_guillotineidleanim", 1)
  90.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  91.     RegisterHam(Ham_Item_AddToPlayer, weapon_guillotine, "fw_AddToPlayer_Post", 1)
  92.     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  93.    
  94.    
  95.     register_clcmd("weapon_guillotine", "hook_weapon")
  96.     g_iItemID = ze_register_item("Gulliton", 250, 1)
  97.     ze_set_item_vip(g_iItemID, "VIP_F")
  98.  
  99.    
  100.     g_MsgDeathMsg = get_user_msgid("DeathMsg")
  101.     gmsgScoreInfo = get_user_msgid("ScoreInfo")
  102. }
  103.  
  104.  
  105. public plugin_precache()
  106. {
  107.     precache_model(v_model)
  108.     precache_model(p_model)
  109.     precache_model(w_model)
  110.     precache_model(KNIFE_MODEL)
  111.     g_pecah = precache_model(PECAH_MODEL)
  112.     precache_sound(hit_wall)
  113.     precache_sound(hit_wall2)
  114.    
  115.     for(new i = 0; i < sizeof(weapon_sound); i++)
  116.         precache_sound(weapon_sound[i])
  117.    
  118.     for(new i = 1; i < sizeof(WeaponResource); i++)
  119.         precache_model(WeaponResource[i])
  120.    
  121.     g_smokepuff_id = engfunc(EngFunc_PrecacheModel, WeaponResource[2])
  122.     m_iBlood[0] = precache_model("sprites/blood.spr")
  123.     m_iBlood[1] = precache_model("sprites/bloodspray.spr")
  124. }
  125.  
  126. public plugin_natives()
  127. {
  128.     register_native("has_guillotine", "native_has_guillotine", 1)
  129.     register_native("give_guillotine", "native_give_guillotine", 1)
  130.     register_native("remove_guillotine", "native_remove_guillotine", 1)
  131. }
  132.  
  133. public native_has_guillotine(id)
  134. {
  135.     return g_had_guillotine[id]
  136. }
  137.  
  138. public native_give_guillotine(id)
  139. {
  140.     get_guillotine(id)
  141. }
  142.  
  143. public native_remove_guillotine(id)
  144. {
  145.     remove_guillotine(id)
  146. }
  147.  
  148. public ze_user_infected(id)
  149. {
  150.     remove_guillotine(id)
  151. }
  152.  
  153. public fw_PlayerKilled(id)
  154. {
  155.     remove_guillotine(id)
  156. }
  157.  
  158. public hook_weapon(id)
  159. {
  160.     engclient_cmd(id, weapon_guillotine)
  161.     return
  162. }
  163.  
  164. public ze_select_item_pre(id, itemid)
  165. {
  166.     // This not our item?
  167.     if (itemid != g_iItemID)
  168.         return ZE_ITEM_AVAILABLE
  169.    
  170.     // Available for Humans only, So don't show it for zombies
  171.     if (ze_is_user_zombie(id))
  172.         return ZE_ITEM_DONT_SHOW
  173.    
  174.     // Finally return that it's available
  175.     return ZE_ITEM_AVAILABLE
  176. }
  177.  
  178. public ze_select_item_post(id, itemid)
  179. {
  180.     // This is not our item, Block it here and don't execute the blew code
  181.     if (itemid != g_iItemID)
  182.         return
  183.    
  184.     get_guillotine(id)
  185. }
  186.  
  187. public get_guillotine(id)
  188. {
  189.     if(!is_user_alive(id))
  190.         return
  191.     drop_weapons(id, 1)
  192.     g_had_guillotine[id] = 1
  193.     g_guillotine_ammo[id] = DEFAULT_AMMO
  194.    
  195.     give_item(id, weapon_guillotine)
  196.     update_ammo(id)
  197.    
  198.     static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_guillotine, id)
  199.     if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  200. }
  201.  
  202. public remove_guillotine(id)
  203. {
  204.     g_had_guillotine[id] = 0
  205. }
  206.  
  207. public refill_guillotine(id)
  208. {  
  209.     if(g_had_guillotine[id]) g_guillotine_ammo[id] = 15
  210.    
  211.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id]) update_ammo(id)
  212. }
  213.    
  214. public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
  215. {
  216.     if(!is_user_alive(id) || !is_user_connected(id))
  217.         return FMRES_IGNORED  
  218.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  219.         set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001)
  220.    
  221.     return FMRES_HANDLED
  222. }
  223.  
  224. public Event_CurWeapon(id)
  225. {
  226.     if(!is_user_alive(id))
  227.         return
  228.        
  229.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  230.     {
  231.         set_pev(id, pev_viewmodel2, v_model)
  232.         set_pev(id, pev_weaponmodel2, p_model)
  233.         set_pdata_string(id, 492 * 4, WEAPON_ANIMEXT, -1 , 20)
  234.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] >= 1) set_weapon_anim(id, ANIM_DRAW)
  235.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] == 0) set_weapon_anim(id, ANIM_DRAW_EMPTY)
  236.         update_ammo(id)
  237.     }
  238.    
  239.     g_old_weapon[id] = get_user_weapon(id)
  240. }
  241.  
  242. public fw_guillotineidleanim(knife)
  243. {
  244.     new id = get_pdata_cbase(knife, 41, 4)
  245.  
  246.     if(!is_user_alive(id) || ze_is_user_zombie(id) || !g_had_guillotine[id] || get_user_weapon(id) != CSW_BDRIPPER)
  247.         return HAM_IGNORED;
  248.    
  249.     if(shoot_mode[id] == 0 && g_guillotine_ammo[id] >= 1)
  250.         return HAM_SUPERCEDE;
  251.    
  252.     if(headshot_mode[id] == 0 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  253.     {
  254.         set_weapon_anim(id, ANIM_IDLE_SHOOT)
  255.         set_pdata_float(knife, 48, 20.0, 4)
  256.         return HAM_SUPERCEDE;
  257.     }
  258.    
  259.     if(headshot_mode[id] == 1 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  260.     {
  261.         set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  262.         set_pdata_float(knife, 48, 20.0, 4)
  263.         return HAM_SUPERCEDE;
  264.     }
  265.    
  266.     if(g_guillotine_ammo[id] == 0 && get_pdata_float(knife, 48, 4) <= 0.25)
  267.     {
  268.         set_weapon_anim(id, ANIM_IDLE_EMPTY)
  269.         set_pdata_float(knife, 48, 20.0, 4)
  270.         return HAM_SUPERCEDE;
  271.     }
  272.  
  273.     return HAM_IGNORED;
  274. }
  275.  
  276. public fw_CmdStart(id, uc_handle, seed)
  277. {
  278.     if(!is_user_alive(id) || !is_user_connected(id))
  279.         return
  280.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  281.         return
  282.    
  283.     static ent; ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  284.     if(!pev_valid(ent))
  285.         return
  286.     if(get_pdata_float(ent, 46, OFFSET_LINUX_WEAPONS) > 0.0 || get_pdata_float(ent, 47, OFFSET_LINUX_WEAPONS) > 0.0)
  287.         return
  288.    
  289.     static CurButton
  290.     CurButton = get_uc(uc_handle, UC_Buttons)
  291.    
  292.     if(CurButton & IN_ATTACK)
  293.     {
  294.         CurButton &= ~IN_ATTACK
  295.         set_uc(uc_handle, UC_Buttons, CurButton)
  296.        
  297.         if(g_guillotine_ammo[id] == 0)
  298.             return
  299.         if(shoot_mode[id] == 0 && get_pdata_float(id, 83, 5) <= 0.0)
  300.         {
  301.             g_guillotine_ammo[id]--
  302.             update_ammo(id)
  303.             shoot_mode[id] = 1
  304.             FireKnife(id)
  305.             set_weapon_anim(id, ANIM_SHOOT)
  306.             emit_sound(id, CHAN_WEAPON, weapon_sound[5], 1.0, ATTN_NORM, 0, PITCH_NORM)
  307.             set_weapons_timeidle(id, CSW_BDRIPPER, 0.7)
  308.             set_player_nextattackx(id, 0.7)
  309.         }
  310.     }
  311. }
  312.  
  313. public FireKnife(id)
  314. {
  315.     static Float:StartOrigin[3], Float:velocity[3], Float:angles[3], Float:anglestrue[3], Float:jarak_max[3]
  316.     get_position(id, 2.0, 0.0, 0.0, StartOrigin)
  317.     get_position(id, 700.0, 0.0, 0.0, jarak_max)
  318.    
  319.     pev(id,pev_v_angle,angles)
  320.     static Ent; Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  321.     if(!pev_valid(Ent)) return
  322.     anglestrue[0] = 360.0 - angles[0]
  323.     anglestrue[1] = angles[1]
  324.     anglestrue[2] = angles[2]
  325.    
  326.     // Set info for ent
  327.     set_pev(Ent, pev_movetype, MOVETYPE_FLY)
  328.     set_pev(Ent, pev_owner, id)
  329.     set_pev(Ent, pev_iuser1, id)
  330.     set_pev(Ent, pev_fuser1, get_gametime() + 4.0)
  331.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  332.    
  333.     entity_set_string(Ent, EV_SZ_classname, BDRIP_CLASSNAME)
  334.     engfunc(EngFunc_SetModel, Ent, KNIFE_MODEL)
  335.     set_pev(Ent, pev_mins, Float:{-1.0, -1.0, -1.0})
  336.     set_pev(Ent, pev_maxs, Float:{1.0, 1.0, 1.0})
  337.     set_pev(Ent, pev_origin, StartOrigin)
  338.     set_pev(Ent, pev_angles, anglestrue)
  339.     set_pev(Ent, pev_gravity, 0.01)
  340.     set_pev(Ent, pev_solid, SOLID_BBOX)
  341.     set_pev(Ent, pev_frame, 1.0)
  342.     set_pev(Ent, pev_framerate, 30.0)
  343.     set_pev(Ent, pev_sequence, 0)
  344.    
  345.     velocity_by_aim( id, 1100, velocity )
  346.     set_pev( Ent, pev_velocity, velocity )
  347.     set_pev(Ent, pev_vuser1, velocity)
  348.     set_pev(Ent, pev_vuser2, jarak_max)
  349.     shoot_ent_mode[id] = 0
  350.     ent_sentuh[id] = 1
  351.     ent_sentuh_balik[id] = 0
  352. }
  353.  
  354. public fm_addtofullpack_post(es, e, user, host, host_flags, player, p_set)
  355. {
  356.     if(!player)
  357.         return FMRES_IGNORED
  358.        
  359.     if(!is_user_connected(host) || !is_user_alive(user))
  360.         return FMRES_IGNORED
  361.        
  362.     if(!ze_is_user_zombie(user) || headshot_korban[user] != 1)
  363.         return FMRES_IGNORED
  364.        
  365.     if(host == user)
  366.         return FMRES_IGNORED
  367.    
  368.     new Float:PlayerOrigin[3], Float:anglesss[3]
  369.     pev(user, pev_origin, PlayerOrigin)
  370.    
  371.     engfunc(EngFunc_GetBonePosition, user, 8, PlayerOrigin, anglesss)
  372.                        
  373.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  374.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  375.  
  376.     return FMRES_HANDLED
  377. }
  378.  
  379. public fw_Think(Ent)
  380. {
  381.     if(!pev_valid(Ent))
  382.         return
  383.    
  384.     static Float:pulang[3], Float:StartOriginz[3], pemilix, Float:brangkat[3], Float:jarak_max[3], Float:origin_asli[3], korban
  385.     pemilix = pev(Ent, pev_iuser1)
  386.     pev(Ent, pev_origin, StartOriginz)
  387.     korban = pev(Ent, pev_iuser2)
  388.    
  389.     if(headshot_korban[korban] == 1)
  390.     {
  391.         if(get_gametime() - 0.2 > pev(Ent, pev_fuser3))
  392.         {
  393.             Damage_guillotine(Ent, korban)
  394.             set_pev(Ent, pev_fuser3, get_gametime())
  395.         }
  396.     }
  397.    
  398.     if(ent_sentuh_balik[pemilix] == 0 && shoot_ent_mode[pemilix] == 1)
  399.     {
  400.         ent_sentuh_balik[pemilix] = 1
  401.         pev(pemilix, pev_origin, origin_asli)
  402.         origin_asli[2] += 7.5
  403.     }
  404.    
  405.     if(ent_sentuh[pemilix] == 1)
  406.     {
  407.         ent_sentuh[pemilix] = 0
  408.         pev(Ent, pev_vuser2, jarak_max)
  409.         pev(Ent, pev_vuser1, brangkat)
  410.         get_speed_vector(StartOriginz, origin_asli, 1100.0, pulang)
  411.                    
  412.         if(shoot_ent_mode[pemilix] == 1)
  413.         {
  414.             set_pev(Ent, pev_velocity, pulang)
  415.         }
  416.         else set_pev(Ent, pev_velocity, brangkat)
  417.     }
  418.    
  419.     if(shoot_ent_mode[pemilix] == 0 && get_distance_f(StartOriginz, jarak_max) <= 10.0)
  420.     {
  421.         shoot_ent_mode[pemilix] = 1
  422.         ent_sentuh[pemilix] = 1
  423.         set_pev(Ent, pev_owner, 0)
  424.     }
  425.    
  426.     if(shoot_ent_mode[pemilix] == 1 && get_distance_f(StartOriginz, origin_asli) <= 10.0)
  427.     {
  428.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  429.         else ancur(Ent)
  430.     }
  431.     else if(headshot_korban[korban] == 1) set_pev(Ent, pev_nextthink, get_gametime() + 0.2)
  432.     else set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  433. }
  434.  
  435. public fw_touch(Ent, Id)
  436. {
  437.     // If ent is valid
  438.     if(!pev_valid(Ent))
  439.         return
  440.     if(pev(Ent, pev_movetype) == MOVETYPE_NONE)
  441.         return
  442.     static classnameptd[32]
  443.     pev(Id, pev_classname, classnameptd, 31)
  444.     if (equali(classnameptd, "func_breakable")) ExecuteHamB( Ham_TakeDamage, Id, 0, 0, 80.0, DMG_GENERIC )
  445.    
  446.     // Get it's origin
  447.     new Float:originF[3], pemilix
  448.     pemilix = pev(Ent, pev_iuser1)
  449.     pev(Ent, pev_origin, originF)
  450.     // Alive...
  451.    
  452.     if(is_user_alive(Id) && ze_is_user_zombie(Id))
  453.     {
  454.         Damage_guillotine(Ent, Id)
  455.         set_pev(Ent, pev_owner, Id)
  456.         ent_sentuh[pemilix] = 1
  457.         create_blood(originF)
  458.         create_blood(originF)
  459.     }
  460.    
  461.     else if(shoot_ent_mode[pemilix] == 1 && Id == pemilix)
  462.     {
  463.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  464.         else ancur(Ent)
  465.     }
  466.    
  467.     else if(is_user_alive(Id) && !ze_is_user_zombie(Id))
  468.     {
  469.         set_pev(Ent, pev_owner, Id)
  470.         ent_sentuh[pemilix] = 1
  471.     }
  472.    
  473.     else
  474.     {
  475.         set_pev(Ent, pev_owner, 0)
  476.  
  477.         if(shoot_ent_mode[pemilix] == 0)
  478.         {
  479.             shoot_ent_mode[pemilix] = 1
  480.             engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  481.             ent_sentuh[pemilix] = 1
  482.         }
  483.         else ancur(Ent)
  484.     }
  485. }
  486.  
  487. public ancur(Ent)
  488. {
  489.     if(!pev_valid(Ent))
  490.         return
  491.     static Float:origin2[3], pemilix, Float:origin3[3]
  492.     pemilix = pev(Ent, pev_iuser1)
  493.     entity_get_vector(Ent, EV_VEC_origin, origin2)
  494.     pev(Ent, pev_origin, origin3)
  495.    
  496.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin2, 0)
  497.     write_byte(TE_BREAKMODEL)
  498.     engfunc(EngFunc_WriteCoord, origin2[0])
  499.     engfunc(EngFunc_WriteCoord, origin2[1])
  500.     engfunc(EngFunc_WriteCoord, origin2[2])
  501.     engfunc(EngFunc_WriteCoord, 25)
  502.     engfunc(EngFunc_WriteCoord, 25)
  503.     engfunc(EngFunc_WriteCoord, 25)
  504.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  505.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  506.     engfunc(EngFunc_WriteCoord, 5)
  507.     write_byte(5)
  508.     write_short(g_pecah)
  509.     write_byte(10)
  510.     write_byte(17)
  511.     write_byte(0x00)
  512.     message_end()
  513.    
  514.     fake_smokes(origin3)
  515.     engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall2, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  516.     shoot_mode[pemilix] = 0
  517.     remove_entity(Ent)
  518.    
  519.     if(!is_user_alive(pemilix) || !is_user_connected(pemilix) || get_user_weapon(pemilix) != CSW_BDRIPPER || !g_had_guillotine[pemilix])
  520.         return
  521.    
  522.     set_weapon_anim(pemilix, ANIM_LOST)
  523.     set_weapons_timeidle(pemilix, CSW_BDRIPPER, 2.5)
  524.     set_player_nextattackx(pemilix, 2.5)
  525.     set_task(1.3, "reload2", pemilix)
  526.     set_task(1.4, "reload", pemilix)
  527. }
  528.  
  529. public reload(id)
  530. {
  531.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  532.         return
  533.    
  534.     set_weapon_anim(id, ANIM_DRAW)
  535. }
  536.  
  537. public reload2(id)
  538. {
  539.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  540.         return
  541.    
  542.     set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  543. }
  544.  
  545. public balik(Ent)
  546. {
  547.     if(!pev_valid(Ent))
  548.         return
  549.     static id
  550.     id = pev(Ent, pev_iuser1)
  551.     set_weapon_anim(id, ANIM_CATCH)
  552.     emit_sound(id, CHAN_WEAPON, weapon_sound[0], 1.0, ATTN_NORM, 0, PITCH_NORM)
  553.     set_weapons_timeidle(id, CSW_BDRIPPER, 1.0)
  554.     set_player_nextattackx(id, 1.0)
  555.     shoot_mode[id] = 0
  556.     g_guillotine_ammo[id]++
  557.     update_ammo(id)
  558.    
  559.     remove_entity(Ent)
  560. }
  561.  
  562. public Damage_guillotine(Ent, Id)
  563. {
  564.     static Owner; Owner = pev(Ent, pev_iuser1)
  565.     static Attacker;
  566.     if(!is_user_alive(Owner))
  567.     {
  568.         Attacker = 0
  569.         return
  570.     } else Attacker = Owner
  571.  
  572.     new bool:bIsHeadShot; // never make that one static
  573.     new Float:flAdjustedDamage, bool:death
  574.        
  575.     switch( Get_MissileWeaponHitGroup(Ent) )
  576.     {
  577.         case HIT_GENERIC: flAdjustedDamage = DAMAGE * 1.0
  578.         case HIT_STOMACH: flAdjustedDamage = DAMAGE * 1.2
  579.         case HIT_LEFTLEG, HIT_RIGHTLEG: flAdjustedDamage = DAMAGE * 1.0
  580.         case HIT_LEFTARM, HIT_RIGHTARM: flAdjustedDamage = DAMAGE * 1.0
  581.         case HIT_HEAD, HIT_CHEST:
  582.         {
  583.             flAdjustedDamage = DAMAGE * 3.0
  584.             bIsHeadShot = true
  585.             if(headshot_mode[Owner] == 0) set_task(2.0, "balik_bro", Ent+1858941 )
  586.             headshot_mode[Owner] = 1
  587.             headshot_korban[Id] = 1
  588.             guillotine_korban[Id] = Ent
  589.             set_pev(Ent, pev_iuser2, Id)
  590.             set_pev(Ent, pev_sequence, 1)
  591.             set_pev(Ent, pev_solid, SOLID_NOT)
  592.             set_pev(Ent, pev_fuser3, 0.0)
  593.         }
  594.     }
  595.     if(pev(Id, pev_health) <= flAdjustedDamage) death = true
  596.    
  597.     if(is_user_alive(Id))
  598.     {
  599.         if( bIsHeadShot && death)
  600.         {
  601.             if(task_exists( Ent+1858941 )) remove_task( Ent + 1858941 )
  602.             set_pev(Ent, pev_sequence, 0)
  603.             headshot_korban[pev(Ent, pev_iuser2)] = 0
  604.             headshot_mode[Owner] = 0
  605.             shoot_ent_mode[Owner] = 1
  606.             ent_sentuh[Owner] = 1
  607.             ent_sentuh_balik[Owner] = 0
  608.             set_pev(Ent, pev_solid, SOLID_BBOX)
  609.             set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  610.    
  611.             kill(Attacker, Id, 1)
  612.            
  613.             death = false          
  614.         }
  615.         if(death)
  616.         {
  617.             kill(Attacker, Id, 0)
  618.            
  619.             death = false          
  620.         }
  621.         else ExecuteHamB(Ham_TakeDamage, Id, Ent, Attacker, flAdjustedDamage, DMG_BULLET)
  622.     }
  623. }
  624.  
  625. public balik_bro(Ent)
  626. {
  627.     Ent -= 1858941
  628.    
  629.     if(!pev_valid(Ent))
  630.         return
  631.    
  632.     static pemilix; pemilix = pev(Ent, pev_iuser1)
  633.     set_pev(Ent, pev_sequence, 0)
  634.     headshot_korban[pev(Ent, pev_iuser2)] = 0
  635.     headshot_mode[pemilix] = 0
  636.     shoot_ent_mode[pemilix] = 1
  637.     ent_sentuh[pemilix] = 1
  638.     ent_sentuh_balik[pemilix] = 0
  639.     set_pev(Ent, pev_solid, SOLID_BBOX)
  640.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  641. }
  642.  
  643. public fw_SetModel(entity, model[])
  644. {
  645.     if(!pev_valid(entity))
  646.         return FMRES_IGNORED
  647.    
  648.     static Classname[64]
  649.     pev(entity, pev_classname, Classname, sizeof(Classname))
  650.    
  651.     if(!equal(Classname, "weaponbox"))
  652.         return FMRES_IGNORED
  653.    
  654.     static id
  655.     id = pev(entity, pev_owner)
  656.    
  657.     if(equal(model, old_w_model))
  658.     {
  659.         static weapon
  660.         weapon = fm_get_user_weapon_entity(entity, CSW_BDRIPPER)
  661.        
  662.         if(!pev_valid(weapon))
  663.             return FMRES_IGNORED
  664.        
  665.         if(g_had_guillotine[id])
  666.         {
  667.             set_pev(weapon, pev_impulse, WEAPON_SECRETCODE)
  668.             set_pev(weapon, pev_iuser4, g_guillotine_ammo[id])
  669.             engfunc(EngFunc_SetModel, entity, w_model)
  670.            
  671.             g_had_guillotine[id] = 0
  672.             g_guillotine_ammo[id] = 0
  673.            
  674.             return FMRES_SUPERCEDE
  675.         }
  676.     }
  677.  
  678.     return FMRES_IGNORED;
  679. }
  680.  
  681. public fw_AddToPlayer_Post(ent, id)
  682. {
  683.     if(pev(ent, pev_impulse) == WEAPON_SECRETCODE)
  684.     {
  685.         g_had_guillotine[id] = 1
  686.         g_guillotine_ammo[id] = pev(ent, pev_iuser4)
  687.        
  688.         set_pev(ent, pev_impulse, 0)
  689.     }          
  690.    
  691.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
  692.     write_string((g_had_guillotine[id] == 1 ? "weapon_guillotine" : "weapon_mac10"))
  693.     write_byte(6)
  694.     write_byte(100)
  695.     write_byte(-1)
  696.     write_byte(-1)
  697.     write_byte(0)
  698.     write_byte(13)
  699.     write_byte(CSW_BDRIPPER)
  700.     write_byte(0)
  701.     message_end()
  702. }
  703.  
  704. public update_ammo(id)
  705. {
  706.     if(!is_user_alive(id))
  707.         return
  708.  
  709.     static weapon_ent; weapon_ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  710.     if(!pev_valid(weapon_ent)) return
  711.    
  712.     cs_set_weapon_ammo(weapon_ent, g_guillotine_ammo[id])  
  713.     cs_set_user_bpammo(id, CSW_BDRIPPER, g_guillotine_ammo[id])
  714.    
  715.     engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, get_user_msgid("CurWeapon"), {0, 0, 0}, id)
  716.     write_byte(1)
  717.     write_byte(CSW_BDRIPPER)
  718.     write_byte(-1)
  719.     message_end()
  720.    
  721.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("AmmoX"), _, id)
  722.     write_byte(1)
  723.     write_byte(g_guillotine_ammo[id])
  724.     message_end()
  725. }
  726.  
  727. public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id,ptr)
  728. {
  729.     if(!is_user_alive(id))
  730.         return HAM_IGNORED
  731.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  732.         return HAM_IGNORED
  733.  
  734.     // get crosshair aim
  735.     static Float:aim[3];
  736.     get_aim(id,v1,aim);
  737.    
  738.     // do another trace to this spot
  739.     new trace = create_tr2();
  740.     engfunc(EngFunc_TraceLine,v1,aim,noMonsters,id,trace);
  741.    
  742.     // copy ints
  743.     set_tr2(ptr,TR_AllSolid,get_tr2(trace,TR_AllSolid));
  744.     set_tr2(ptr,TR_StartSolid,get_tr2(trace,TR_StartSolid));
  745.     set_tr2(ptr,TR_InOpen,get_tr2(trace,TR_InOpen));
  746.     set_tr2(ptr,TR_InWater,get_tr2(trace,TR_InWater));
  747.     set_tr2(ptr,TR_pHit,get_tr2(trace,TR_pHit));
  748.     set_tr2(ptr,TR_iHitgroup,get_tr2(trace,TR_iHitgroup));
  749.  
  750.     // copy floats
  751.     get_tr2(trace,TR_flFraction,aim[0]);
  752.     set_tr2(ptr,TR_flFraction,aim[0]);
  753.     get_tr2(trace,TR_flPlaneDist,aim[0]);
  754.     set_tr2(ptr,TR_flPlaneDist,aim[0]);
  755.    
  756.     // copy vecs
  757.     get_tr2(trace,TR_vecEndPos,aim);
  758.     set_tr2(ptr,TR_vecEndPos,aim);
  759.     get_tr2(trace,TR_vecPlaneNormal,aim);
  760.     set_tr2(ptr,TR_vecPlaneNormal,aim);
  761.  
  762.     // get rid of new trace
  763.     free_tr2(trace);
  764.  
  765.     return FMRES_IGNORED;
  766. }
  767.  
  768. get_aim(id,Float:source[3],Float:ret[3])
  769. {
  770.     static Float:vAngle[3], Float:pAngle[3], Float:dir[3], Float:temp[3];
  771.  
  772.     // get aiming direction from forward global based on view angle and punch angle
  773.     pev(id,pev_v_angle,vAngle);
  774.     pev(id,pev_punchangle,pAngle);
  775.     xs_vec_add(vAngle,pAngle,temp);
  776.     engfunc(EngFunc_MakeVectors,temp);
  777.     global_get(glb_v_forward,dir);
  778.    
  779.     /* vecEnd = vecSrc + vecDir * flDistance; */
  780.     xs_vec_mul_scalar(dir,8192.0,temp);
  781.     xs_vec_add(source,temp,ret);
  782. }
  783.  
  784. public fake_smokes(Float:Origin[3])
  785. {
  786.     static TE_FLAG
  787.    
  788.     TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
  789.     TE_FLAG |= TE_EXPLFLAG_NOSOUND
  790.     TE_FLAG |= TE_EXPLFLAG_NOPARTICLES
  791.    
  792.     engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, Origin, 0)
  793.     write_byte(TE_EXPLOSION)
  794.     engfunc(EngFunc_WriteCoord, Origin[0])
  795.     engfunc(EngFunc_WriteCoord, Origin[1])
  796.     engfunc(EngFunc_WriteCoord, Origin[2])
  797.     write_short(g_smokepuff_id)
  798.     write_byte(6)
  799.     write_byte(25)
  800.     write_byte(TE_FLAG)
  801.     message_end()
  802. }
  803.  
  804. stock set_weapon_anim(id, anim)
  805. {
  806.     if(!is_user_alive(id))
  807.         return
  808.    
  809.     set_pev(id, pev_weaponanim, anim)
  810.    
  811.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id)
  812.     write_byte(anim)
  813.     write_byte(pev(id, pev_body))
  814.     message_end()
  815. }
  816.  
  817. stock kill(k, v, headshot)
  818. {
  819.     cs_set_user_money(k, cs_get_user_money(k) + 500)
  820.    
  821.     set_user_frags(k, get_user_frags(k) + 1)
  822.    
  823.     set_msg_block(g_MsgDeathMsg,BLOCK_ONCE)
  824.     set_msg_block(gmsgScoreInfo,BLOCK_ONCE)
  825.     user_kill(v,1)
  826.    
  827.     new kteam = get_user_team(k);
  828.     new vteam = get_user_team(v);
  829.    
  830.     new kfrags = get_user_frags(k);
  831.     new kdeaths = get_user_deaths(k);
  832.    
  833.     new vfrags = get_user_frags(v);
  834.     new vdeaths = get_user_deaths(v);
  835.    
  836.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  837.     ewrite_byte(k);
  838.     ewrite_short(kfrags);
  839.     ewrite_short(kdeaths);
  840.     ewrite_short(0);
  841.     ewrite_short(kteam);
  842.     emessage_end();
  843.    
  844.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  845.     ewrite_byte(v);
  846.     ewrite_short(vfrags);
  847.     ewrite_short(vdeaths);
  848.     ewrite_short(0);
  849.     ewrite_short(vteam);
  850.     emessage_end();
  851.    
  852.     emessage_begin(MSG_BROADCAST, g_MsgDeathMsg)
  853.     ewrite_byte(k)
  854.     ewrite_byte(v)
  855.     ewrite_byte(headshot)
  856.     ewrite_string("Blood Dripper")
  857.     emessage_end()
  858. }
  859.  
  860.  
  861. stock create_blood(const Float:origin[3])
  862. {
  863.     // Show some blood :)
  864.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  865.     write_byte(TE_BLOODSPRITE)
  866.     engfunc(EngFunc_WriteCoord, origin[0])
  867.     engfunc(EngFunc_WriteCoord, origin[1])
  868.     engfunc(EngFunc_WriteCoord, origin[2])
  869.     write_short(m_iBlood[1])
  870.     write_short(m_iBlood[0])
  871.     write_byte(75)
  872.     write_byte(8)
  873.     message_end()
  874. }
  875.  
  876. stock drop_weapons(id, dropwhat)
  877. {
  878.     static weapons[32], num, i, weaponid
  879.     num = 0
  880.     get_user_weapons(id, weapons, num)
  881.      
  882.     for (i = 0; i < num; i++)
  883.     {
  884.         weaponid = weapons[i]
  885.          
  886.         if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
  887.         {
  888.             static wname[32]
  889.             get_weaponname(weaponid, wname, sizeof wname - 1)
  890.             engclient_cmd(id, "drop", wname)
  891.         }
  892.     }
  893. }
  894.  
  895. stock Get_MissileWeaponHitGroup( iEnt )
  896. {
  897.     new Float:flStart[ 3 ], Float:flEnd[ 3 ];
  898.    
  899.     pev( iEnt, pev_origin, flStart );
  900.     pev( iEnt, pev_velocity, flEnd );
  901.     xs_vec_add( flStart, flEnd, flEnd );
  902.    
  903.     new ptr = create_tr2();
  904.     engfunc( EngFunc_TraceLine, flStart, flEnd, 0, iEnt, ptr );
  905.    
  906.     new iHitGroup, Owner, nOhead, head
  907.     Owner = pev(iEnt, pev_iuser1)
  908.     nOhead = get_tr2( ptr, TR_iHitgroup )
  909.     head = set_tr2( ptr, TR_iHitgroup, HIT_HEAD )
  910.    
  911.     iHitGroup = headshot_mode[Owner] ? head : nOhead
  912.    
  913.     free_tr2( ptr );
  914.    
  915.     return iHitGroup;
  916. }
  917.  
  918. stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
  919. {
  920.     new_velocity[0] = origin2[0] - origin1[0]
  921.     new_velocity[1] = origin2[1] - origin1[1]
  922.     new_velocity[2] = origin2[2] - origin1[2]
  923.     static Float:num; num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
  924.     new_velocity[0] *= num
  925.     new_velocity[1] *= num
  926.     new_velocity[2] *= num
  927.    
  928.     return 1;
  929. }
  930.  
  931. stock get_position(id,Float:forw, Float:right, Float:up, Float:vStart[])
  932. {
  933.     static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
  934.    
  935.     pev(id, pev_origin, vOrigin)
  936.     pev(id, pev_view_ofs, vUp) //for player
  937.     xs_vec_add(vOrigin, vUp, vOrigin)
  938.     pev(id, pev_v_angle, vAngle) // if normal entity ,use pev_angles
  939.    
  940.     angle_vector(vAngle, ANGLEVECTOR_FORWARD, vForward) //or use EngFunc_AngleVectors
  941.     angle_vector(vAngle, ANGLEVECTOR_RIGHT, vRight)
  942.     angle_vector(vAngle, ANGLEVECTOR_UP, vUp)
  943.    
  944.     vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up
  945.     vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up
  946.     vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up
  947. }
  948.  
  949. stock set_weapons_timeidle(id, WeaponId ,Float:TimeIdle)
  950. {
  951.     if(!is_user_alive(id))
  952.         return
  953.        
  954.     static entwpn; entwpn = fm_get_user_weapon_entity(id, WeaponId)
  955.     if(!pev_valid(entwpn))
  956.         return
  957.        
  958.     set_pdata_float(entwpn, 48, TimeIdle + 0.2, OFFSET_LINUX_WEAPONS)
  959. }
  960.  
  961. stock set_player_nextattackx(id, Float:nexttime)
  962. {
  963.     if(!is_user_alive(id))
  964.         return
  965.        
  966.     set_pdata_float(id, 83, nexttime, 5)
  967. }
  968.  
#define CSW_MAC10 change it to CSW_KNIFE

then find weapon_mac
change weapon_mac to weapon_knife as u find...

Just replace csw_mac10 with csw_knife and weapon_mac10 with weapon_knife dont edit anything else it will give bug.. and i believe this guillotine plugin will give runtime error 10...
51.79.157.106:27017

VicKy
Mod Tester
Mod Tester
Pakistan
Posts: 82
Joined: 1 Year Ago
Has thanked: 14 times
Been thanked: 11 times
Age: 19
Contact:

#3

Post by VicKy » 1 Month Ago

I Tried This One !!
Got Error

Code :-
  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <fakemeta_util>
  4. #include <cstrike>
  5. #include <fun>
  6. #include <amxmodx>
  7.  
  8. #define PLUGIN "Blood-Dripper"
  9. #define VERSION "1.0"
  10. #define AUTHOR "m4m3ts"
  11.  
  12. #define CSW_BDRIPPER CSW_KNIFE
  13. #define weapon_guillotine "weapon_knife"
  14. #define old_event "events/mac10.sc"
  15. #define old_w_model "models/w_mac10.mdl"
  16. #define WEAPON_SECRETCODE 1329419
  17.  
  18.  
  19. #define DEFAULT_AMMO 100
  20. #define DAMAGE 50
  21. #define BDRIP_CLASSNAME "Blood Dripper"
  22. #define WEAPON_ANIMEXT "knife"
  23.  
  24. #define Get_Ent_Data(%1,%2) get_pdata_int(%1,%2,4)
  25. #define Set_Ent_Data(%1,%2,%3) set_pdata_int(%1,%2,%3,4)
  26.  
  27. const PDATA_SAFE = 2
  28. const OFFSET_LINUX_WEAPONS = 4
  29. const OFFSET_WEAPONOWNER = 41
  30.  
  31. new const v_model[] = "models/FuriX/v_guillotine_furix_v3.mdl"
  32. new const p_model[] = "models/zombie_escape/p_guillotine.mdl"
  33. new const w_model[] = "models/zombie_escape/w_guillotine.mdl"
  34. new const KNIFE_MODEL[] = "models/zombie_escape/guillotine_projectile.mdl"
  35. new const PECAH_MODEL[] = "models/zombie_escape/gibs_guilotine.mdl"
  36. new const hit_wall[] = "weapons/janus9_stone1.wav"
  37. new const hit_wall2[] = "weapons/janus9_stone2.wav"
  38. new const weapon_sound[6][] =
  39. {
  40.     "weapons/guillotine_catch2.wav",
  41.     "weapons/guillotine_draw.wav",
  42.     "weapons/guillotine_draw_empty.wav",
  43.     "weapons/guillotine_explode.wav",
  44.     "weapons/guillotine_red.wav",
  45.     "weapons/guillotine-1.wav"
  46. }
  47.  
  48.  
  49. new const WeaponResource[3][] =
  50. {
  51.     "sprites/weapon_guillotine.txt",
  52.     "sprites/640hud120.spr",
  53.     "sprites/guillotine_lost.spr"
  54. }
  55.  
  56. enum
  57. {
  58.     ANIM_IDLE = 0,
  59.     ANIM_IDLE_EMPTY,
  60.     ANIM_SHOOT,
  61.     ANIM_DRAW,
  62.     ANIM_DRAW_EMPTY,
  63.     ANIM_IDLE_SHOOT,
  64.     ANIM_IDLE_SHOOT2,
  65.     ANIM_CATCH,
  66.     ANIM_LOST
  67. }
  68.  
  69. new g_MsgDeathMsg
  70.  
  71. new g_had_guillotine[33], g_guillotine_ammo[33], shoot_mode[33], shoot_ent_mode[33], g_pecah, headshot_mode[33], ent_sentuh[33], ent_sentuh_balik[33]
  72. new g_old_weapon[33], g_smokepuff_id, m_iBlood[2], guillotine_korban[33], headshot_korban[33], gmsgScoreInfo
  73. new g_iItemID
  74.  
  75. const PRIMARY_WEAPONS_BIT_SUM =
  76. (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
  77. CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
  78.  
  79. public plugin_init()
  80. {
  81.     register_plugin(PLUGIN, VERSION, AUTHOR)
  82.     register_cvar("guillotine_version", "m4m3ts", FCVAR_SERVER|FCVAR_SPONLY)
  83.     register_forward(FM_CmdStart, "fw_CmdStart")
  84.     register_forward(FM_SetModel, "fw_SetModel")
  85.     register_think(BDRIP_CLASSNAME, "fw_Think")
  86.     register_touch(BDRIP_CLASSNAME, "*", "fw_touch")
  87.     register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
  88.     register_forward(FM_TraceLine, "fw_traceline", 1)
  89.     register_forward(FM_AddToFullPack, "fm_addtofullpack_post", 1)
  90.     RegisterHam(Ham_Weapon_WeaponIdle, weapon_guillotine, "fw_guillotineidleanim", 1)
  91.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  92.     RegisterHam(Ham_Item_AddToPlayer, weapon_guillotine, "fw_AddToPlayer_Post", 1)
  93.     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  94.    
  95.    
  96.     register_clcmd("weapon_guillotine", "hook_weapon")
  97.     g_iItemID = ze_register_item("Gulliton", 250, 1)
  98.     ze_set_item_vip(g_iItemID, "VIP_F")
  99.  
  100.    
  101.     g_MsgDeathMsg = get_user_msgid("DeathMsg")
  102.     gmsgScoreInfo = get_user_msgid("ScoreInfo")
  103. }
  104.  
  105.  
  106. public plugin_precache()
  107. {
  108.     precache_model(v_model)
  109.     precache_model(p_model)
  110.     precache_model(w_model)
  111.     precache_model(KNIFE_MODEL)
  112.     g_pecah = precache_model(PECAH_MODEL)
  113.     precache_sound(hit_wall)
  114.     precache_sound(hit_wall2)
  115.    
  116.     for(new i = 0; i < sizeof(weapon_sound); i++)
  117.         precache_sound(weapon_sound[i])
  118.    
  119.     for(new i = 1; i < sizeof(WeaponResource); i++)
  120.         precache_model(WeaponResource[i])
  121.    
  122.     g_smokepuff_id = engfunc(EngFunc_PrecacheModel, WeaponResource[2])
  123.     m_iBlood[0] = precache_model("sprites/blood.spr")
  124.     m_iBlood[1] = precache_model("sprites/bloodspray.spr")
  125. }
  126. /*
  127. public ze_game_started_pre()
  128. {
  129.        if (get_user_flags(id) & ADMIN_LEVEL_G)
  130.         {
  131.           get_guillotine(id)
  132.         }  
  133.     }  
  134.  
  135. /*    
  136. public get_blood(id)
  137. {
  138.        if(!is_user_alive(id))
  139.             return
  140.  
  141.         g_had_guillotine[id] = 1
  142.         g_guillotine_ammo[id] = 9999
  143.         give_item(id, weapon_guillotine)
  144.         update_ammo(id)
  145.         //static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_guillotine, id)
  146.         //if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  147.     }
  148.  */    
  149. public plugin_natives()
  150. {
  151.     register_native("has_guillotine", "native_has_guillotine", 1)
  152.     register_native("give_guillotine", "native_give_guillotine", 1)
  153.     register_native("remove_guillotine", "native_remove_guillotine", 1)
  154. }
  155.  
  156. public native_has_guillotine(id)
  157. {
  158.     return g_had_guillotine[id]
  159. }
  160.  
  161. public native_give_guillotine(id)
  162. {
  163.     get_guillotine(id)
  164. }
  165.  
  166. public native_remove_guillotine(id)
  167. {
  168.     remove_guillotine(id)
  169. }
  170.  
  171. public ze_user_infected(id)
  172. {
  173.     remove_guillotine(id)
  174. }
  175.  
  176. public fw_PlayerKilled(id)
  177. {
  178.     remove_guillotine(id)
  179. }
  180.  
  181. public hook_weapon(id)
  182. {
  183.     engclient_cmd(id, weapon_guillotine)
  184.     return
  185. }
  186.  
  187. public ze_select_item_pre(id, itemid)
  188. {
  189.     // This not our item?
  190.     if (itemid != g_iItemID)
  191.         return ZE_ITEM_AVAILABLE
  192.    
  193.     // Available for Humans only, So don't show it for zombies
  194.     if (ze_is_user_zombie(id))
  195.         return ZE_ITEM_DONT_SHOW
  196.    
  197.     // Finally return that it's available
  198.     return ZE_ITEM_AVAILABLE
  199. }
  200.  
  201. public ze_select_item_post(id, itemid)
  202. {
  203.     // This is not our item, Block it here and don't execute the blew code
  204.     if (itemid != g_iItemID)
  205.         return
  206.    
  207.     get_guillotine(id)
  208. }
  209.  
  210. public get_guillotine(id)
  211. {
  212.     if(!is_user_alive(id))
  213.         return
  214.    // drop_weapons(id, 1)
  215.     g_had_guillotine[id] = 1
  216.     g_guillotine_ammo[id] = 100
  217.    
  218.     give_item(id, weapon_guillotine)
  219.     update_ammo(id)
  220.    
  221.     static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_guillotine, id)
  222.     if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  223. }
  224.  
  225. public remove_guillotine(id)
  226. {
  227.     g_had_guillotine[id] = 0
  228. }
  229.  
  230. public refill_guillotine(id)
  231. {  
  232.     if(g_had_guillotine[id]) g_guillotine_ammo[id] = 15
  233.    
  234.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id]) update_ammo(id)
  235. }
  236.    
  237. public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
  238. {
  239.     if(!is_user_alive(id) || !is_user_connected(id))
  240.         return FMRES_IGNORED  
  241.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  242.         set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001)
  243.    
  244.     return FMRES_HANDLED
  245. }
  246.  
  247. public Event_CurWeapon(id)
  248. {
  249.     if(!is_user_alive(id))
  250.         return
  251.        
  252.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  253.     {
  254.         set_pev(id, pev_viewmodel2, v_model)
  255.         set_pev(id, pev_weaponmodel2, p_model)
  256.         set_pdata_string(id, 492 * 4, WEAPON_ANIMEXT, -1 , 20)
  257.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] >= 1) set_weapon_anim(id, ANIM_DRAW)
  258.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] == 0) set_weapon_anim(id, ANIM_DRAW_EMPTY)
  259.         update_ammo(id)
  260.     }
  261.    
  262.     g_old_weapon[id] = get_user_weapon(id)
  263. }
  264.  
  265. public fw_guillotineidleanim(knife)
  266. {
  267.     new id = get_pdata_cbase(knife, 41, 4)
  268.  
  269.     if(!is_user_alive(id) || ze_is_user_zombie(id) || !g_had_guillotine[id] || get_user_weapon(id) != CSW_BDRIPPER)
  270.         return HAM_IGNORED;
  271.    
  272.     if(shoot_mode[id] == 0 && g_guillotine_ammo[id] >= 1)
  273.         return HAM_SUPERCEDE;
  274.    
  275.     if(headshot_mode[id] == 0 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  276.     {
  277.         set_weapon_anim(id, ANIM_IDLE_SHOOT)
  278.         set_pdata_float(knife, 48, 20.0, 4)
  279.         return HAM_SUPERCEDE;
  280.     }
  281.    
  282.     if(headshot_mode[id] == 1 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  283.     {
  284.         set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  285.         set_pdata_float(knife, 48, 20.0, 4)
  286.         return HAM_SUPERCEDE;
  287.     }
  288.    
  289.     if(g_guillotine_ammo[id] == 0 && get_pdata_float(knife, 48, 4) <= 0.25)
  290.     {
  291.         set_weapon_anim(id, ANIM_IDLE_EMPTY)
  292.         set_pdata_float(knife, 48, 20.0, 4)
  293.         return HAM_SUPERCEDE;
  294.     }
  295.  
  296.     return HAM_IGNORED;
  297. }
  298.  
  299. public fw_CmdStart(id, uc_handle, seed)
  300. {
  301.     if(!is_user_alive(id) || !is_user_connected(id))
  302.         return
  303.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  304.         return
  305.    
  306.     static ent; ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  307.     if(!pev_valid(ent))
  308.         return
  309.     if(get_pdata_float(ent, 46, OFFSET_LINUX_WEAPONS) > 0.0 || get_pdata_float(ent, 47, OFFSET_LINUX_WEAPONS) > 0.0)
  310.         return
  311.    
  312.     static CurButton
  313.     CurButton = get_uc(uc_handle, UC_Buttons)
  314.    
  315.     if(CurButton & IN_ATTACK)
  316.     {
  317.         CurButton &= ~IN_ATTACK
  318.         set_uc(uc_handle, UC_Buttons, CurButton)
  319.        
  320.         if(g_guillotine_ammo[id] == 0)
  321.             return
  322.         if(shoot_mode[id] == 0 && get_pdata_float(id, 83, 5) <= 0.0)
  323.         {
  324.             g_guillotine_ammo[id]--
  325.             update_ammo(id)
  326.             shoot_mode[id] = 1
  327.             FireKnife(id)
  328.             set_weapon_anim(id, ANIM_SHOOT)
  329.             emit_sound(id, CHAN_WEAPON, weapon_sound[5], 1.0, ATTN_NORM, 0, PITCH_NORM)
  330.             set_weapons_timeidle(id, CSW_BDRIPPER, 0.7)
  331.             set_player_nextattackx(id, 0.7)
  332.         }
  333.     }
  334. }
  335.  
  336. public FireKnife(id)
  337. {
  338.     static Float:StartOrigin[3], Float:velocity[3], Float:angles[3], Float:anglestrue[3], Float:jarak_max[3]
  339.     get_position(id, 2.0, 0.0, 0.0, StartOrigin)
  340.     get_position(id, 700.0, 0.0, 0.0, jarak_max)
  341.    
  342.     pev(id,pev_v_angle,angles)
  343.     static Ent; Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  344.     if(!pev_valid(Ent)) return
  345.     anglestrue[0] = 360.0 - angles[0]
  346.     anglestrue[1] = angles[1]
  347.     anglestrue[2] = angles[2]
  348.    
  349.     // Set info for ent
  350.     set_pev(Ent, pev_movetype, MOVETYPE_FLY)
  351.     set_pev(Ent, pev_owner, id)
  352.     set_pev(Ent, pev_iuser1, id)
  353.     set_pev(Ent, pev_fuser1, get_gametime() + 4.0)
  354.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  355.    
  356.     entity_set_string(Ent, EV_SZ_classname, BDRIP_CLASSNAME)
  357.     engfunc(EngFunc_SetModel, Ent, KNIFE_MODEL)
  358.     set_pev(Ent, pev_mins, Float:{-1.0, -1.0, -1.0})
  359.     set_pev(Ent, pev_maxs, Float:{1.0, 1.0, 1.0})
  360.     set_pev(Ent, pev_origin, StartOrigin)
  361.     set_pev(Ent, pev_angles, anglestrue)
  362.     set_pev(Ent, pev_gravity, 0.01)
  363.     set_pev(Ent, pev_solid, SOLID_BBOX)
  364.     set_pev(Ent, pev_frame, 1.0)
  365.     set_pev(Ent, pev_framerate, 30.0)
  366.     set_pev(Ent, pev_sequence, 0)
  367.    
  368.     velocity_by_aim( id, 1100, velocity )
  369.     set_pev( Ent, pev_velocity, velocity )
  370.     set_pev(Ent, pev_vuser1, velocity)
  371.     set_pev(Ent, pev_vuser2, jarak_max)
  372.     shoot_ent_mode[id] = 0
  373.     ent_sentuh[id] = 1
  374.     ent_sentuh_balik[id] = 0
  375. }
  376.  
  377. public fm_addtofullpack_post(es, e, user, host, host_flags, player, p_set)
  378. {
  379.     if(!player)
  380.         return FMRES_IGNORED
  381.        
  382.     if(!is_user_connected(host) || !is_user_alive(user))
  383.         return FMRES_IGNORED
  384.        
  385.     if(!ze_is_user_zombie(user) || headshot_korban[user] != 1)
  386.         return FMRES_IGNORED
  387.        
  388.     if(host == user)
  389.         return FMRES_IGNORED
  390.    
  391.     new Float:PlayerOrigin[3], Float:anglesss[3]
  392.     pev(user, pev_origin, PlayerOrigin)
  393.    
  394.     engfunc(EngFunc_GetBonePosition, user, 8, PlayerOrigin, anglesss)
  395.                        
  396.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  397.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  398.  
  399.     return FMRES_HANDLED
  400. }
  401.  
  402. public fw_Think(Ent)
  403. {
  404.     if(!pev_valid(Ent))
  405.         return
  406.    
  407.     static Float:pulang[3], Float:StartOriginz[3], pemilix, Float:brangkat[3], Float:jarak_max[3], Float:origin_asli[3], korban
  408.     pemilix = pev(Ent, pev_iuser1)
  409.     pev(Ent, pev_origin, StartOriginz)
  410.     korban = pev(Ent, pev_iuser2)
  411.    
  412.     if(headshot_korban[korban] == 1)
  413.     {
  414.         if(get_gametime() - 0.2 > pev(Ent, pev_fuser3))
  415.         {
  416.             Damage_guillotine(Ent, korban)
  417.             set_pev(Ent, pev_fuser3, get_gametime())
  418.         }
  419.     }
  420.    
  421.     if(ent_sentuh_balik[pemilix] == 0 && shoot_ent_mode[pemilix] == 1)
  422.     {
  423.         ent_sentuh_balik[pemilix] = 1
  424.         pev(pemilix, pev_origin, origin_asli)
  425.         origin_asli[2] += 7.5
  426.     }
  427.    
  428.     if(ent_sentuh[pemilix] == 1)
  429.     {
  430.         ent_sentuh[pemilix] = 0
  431.         pev(Ent, pev_vuser2, jarak_max)
  432.         pev(Ent, pev_vuser1, brangkat)
  433.         get_speed_vector(StartOriginz, origin_asli, 1100.0, pulang)
  434.                    
  435.         if(shoot_ent_mode[pemilix] == 1)
  436.         {
  437.             set_pev(Ent, pev_velocity, pulang)
  438.         }
  439.         else set_pev(Ent, pev_velocity, brangkat)
  440.     }
  441.    
  442.     if(shoot_ent_mode[pemilix] == 0 && get_distance_f(StartOriginz, jarak_max) <= 10.0)
  443.     {
  444.         shoot_ent_mode[pemilix] = 1
  445.         ent_sentuh[pemilix] = 1
  446.         set_pev(Ent, pev_owner, 0)
  447.     }
  448.    
  449.     if(shoot_ent_mode[pemilix] == 1 && get_distance_f(StartOriginz, origin_asli) <= 10.0)
  450.     {
  451.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  452.         else ancur(Ent)
  453.     }
  454.     else if(headshot_korban[korban] == 1) set_pev(Ent, pev_nextthink, get_gametime() + 0.2)
  455.     else set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  456. }
  457.  
  458. public fw_touch(Ent, Id)
  459. {
  460.     // If ent is valid
  461.     if(!pev_valid(Ent))
  462.         return
  463.     if(pev(Ent, pev_movetype) == MOVETYPE_NONE)
  464.         return
  465.     static classnameptd[32]
  466.     pev(Id, pev_classname, classnameptd, 31)
  467.     if (equali(classnameptd, "func_breakable")) ExecuteHamB( Ham_TakeDamage, Id, 0, 0, 80.0, DMG_GENERIC )
  468.    
  469.     // Get it's origin
  470.     new Float:originF[3], pemilix
  471.     pemilix = pev(Ent, pev_iuser1)
  472.     pev(Ent, pev_origin, originF)
  473.     // Alive...
  474.    
  475.     if(is_user_alive(Id) && ze_is_user_zombie(Id))
  476.     {
  477.         Damage_guillotine(Ent, Id)
  478.         set_pev(Ent, pev_owner, Id)
  479.         ent_sentuh[pemilix] = 1
  480.         create_blood(originF)
  481.         create_blood(originF)
  482.     }
  483.    
  484.     else if(shoot_ent_mode[pemilix] == 1 && Id == pemilix)
  485.     {
  486.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  487.         else ancur(Ent)
  488.     }
  489.    
  490.     else if(is_user_alive(Id) && !ze_is_user_zombie(Id))
  491.     {
  492.         set_pev(Ent, pev_owner, Id)
  493.         ent_sentuh[pemilix] = 1
  494.     }
  495.    
  496.     else
  497.     {
  498.         set_pev(Ent, pev_owner, 0)
  499.  
  500.         if(shoot_ent_mode[pemilix] == 0)
  501.         {
  502.             shoot_ent_mode[pemilix] = 1
  503.             engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  504.             ent_sentuh[pemilix] = 1
  505.         }
  506.         else ancur(Ent)
  507.     }
  508. }
  509.  
  510. public ancur(Ent)
  511. {
  512.     if(!pev_valid(Ent))
  513.         return
  514.     static Float:origin2[3], pemilix, Float:origin3[3]
  515.     pemilix = pev(Ent, pev_iuser1)
  516.     entity_get_vector(Ent, EV_VEC_origin, origin2)
  517.     pev(Ent, pev_origin, origin3)
  518.    
  519.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin2, 0)
  520.     write_byte(TE_BREAKMODEL)
  521.     engfunc(EngFunc_WriteCoord, origin2[0])
  522.     engfunc(EngFunc_WriteCoord, origin2[1])
  523.     engfunc(EngFunc_WriteCoord, origin2[2])
  524.     engfunc(EngFunc_WriteCoord, 25)
  525.     engfunc(EngFunc_WriteCoord, 25)
  526.     engfunc(EngFunc_WriteCoord, 25)
  527.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  528.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  529.     engfunc(EngFunc_WriteCoord, 5)
  530.     write_byte(5)
  531.     write_short(g_pecah)
  532.     write_byte(10)
  533.     write_byte(17)
  534.     write_byte(0x00)
  535.     message_end()
  536.    
  537.     fake_smokes(origin3)
  538.     engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall2, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  539.     shoot_mode[pemilix] = 0
  540.     remove_entity(Ent)
  541.    
  542.     if(!is_user_alive(pemilix) || !is_user_connected(pemilix) || get_user_weapon(pemilix) != CSW_BDRIPPER || !g_had_guillotine[pemilix])
  543.         return
  544.    
  545.     set_weapon_anim(pemilix, ANIM_LOST)
  546.     set_weapons_timeidle(pemilix, CSW_BDRIPPER, 2.5)
  547.     set_player_nextattackx(pemilix, 2.5)
  548.     set_task(1.3, "reload2", pemilix)
  549.     set_task(1.4, "reload", pemilix)
  550. }
  551.  
  552. public reload(id)
  553. {
  554.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  555.         return
  556.    
  557.     set_weapon_anim(id, ANIM_DRAW)
  558. }
  559.  
  560. public reload2(id)
  561. {
  562.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  563.         return
  564.    
  565.     set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  566. }
  567.  
  568. public balik(Ent)
  569. {
  570.     if(!pev_valid(Ent))
  571.         return
  572.     static id
  573.     id = pev(Ent, pev_iuser1)
  574.     set_weapon_anim(id, ANIM_CATCH)
  575.     emit_sound(id, CHAN_WEAPON, weapon_sound[0], 1.0, ATTN_NORM, 0, PITCH_NORM)
  576.     set_weapons_timeidle(id, CSW_BDRIPPER, 1.0)
  577.     set_player_nextattackx(id, 1.0)
  578.     shoot_mode[id] = 0
  579.     g_guillotine_ammo[id]++
  580.     update_ammo(id)
  581.    
  582.     remove_entity(Ent)
  583. }
  584.  
  585. public Damage_guillotine(Ent, Id)
  586. {
  587.     static Owner; Owner = pev(Ent, pev_iuser1)
  588.     static Attacker;
  589.     if(!is_user_alive(Owner))
  590.     {
  591.         Attacker = 0
  592.         return
  593.     } else Attacker = Owner
  594.  
  595.     new bool:bIsHeadShot; // never make that one static
  596.     new Float:flAdjustedDamage, bool:death
  597.        
  598.     switch( Get_MissileWeaponHitGroup(Ent) )
  599.     {
  600.         case HIT_GENERIC: flAdjustedDamage = DAMAGE * 1.0
  601.         case HIT_STOMACH: flAdjustedDamage = DAMAGE * 1.2
  602.         case HIT_LEFTLEG, HIT_RIGHTLEG: flAdjustedDamage = DAMAGE * 1.0
  603.         case HIT_LEFTARM, HIT_RIGHTARM: flAdjustedDamage = DAMAGE * 1.0
  604.         case HIT_HEAD, HIT_CHEST:
  605.         {
  606.             flAdjustedDamage = DAMAGE * 3.0
  607.             bIsHeadShot = true
  608.             if(headshot_mode[Owner] == 0) set_task(2.0, "balik_bro", Ent+1858941 )
  609.             headshot_mode[Owner] = 1
  610.             headshot_korban[Id] = 1
  611.             guillotine_korban[Id] = Ent
  612.             set_pev(Ent, pev_iuser2, Id)
  613.             set_pev(Ent, pev_sequence, 1)
  614.             set_pev(Ent, pev_solid, SOLID_NOT)
  615.             set_pev(Ent, pev_fuser3, 0.0)
  616.         }
  617.     }
  618.     if(pev(Id, pev_health) <= flAdjustedDamage) death = true
  619.    
  620.     if(is_user_alive(Id))
  621.     {
  622.         if( bIsHeadShot && death)
  623.         {
  624.             if(task_exists( Ent+1858941 )) remove_task( Ent + 1858941 )
  625.             set_pev(Ent, pev_sequence, 0)
  626.             headshot_korban[pev(Ent, pev_iuser2)] = 0
  627.             headshot_mode[Owner] = 0
  628.             shoot_ent_mode[Owner] = 1
  629.             ent_sentuh[Owner] = 1
  630.             ent_sentuh_balik[Owner] = 0
  631.             set_pev(Ent, pev_solid, SOLID_BBOX)
  632.             set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  633.    
  634.             kill(Attacker, Id, 1)
  635.            
  636.             death = false          
  637.         }
  638.         if(death)
  639.         {
  640.             kill(Attacker, Id, 0)
  641.            
  642.             death = false          
  643.         }
  644.         else ExecuteHamB(Ham_TakeDamage, Id, Ent, Attacker, flAdjustedDamage, DMG_BULLET)
  645.     }
  646. }
  647.  
  648. public balik_bro(Ent)
  649. {
  650.     Ent -= 1858941
  651.    
  652.     if(!pev_valid(Ent))
  653.         return
  654.    
  655.     static pemilix; pemilix = pev(Ent, pev_iuser1)
  656.     set_pev(Ent, pev_sequence, 0)
  657.     headshot_korban[pev(Ent, pev_iuser2)] = 0
  658.     headshot_mode[pemilix] = 0
  659.     shoot_ent_mode[pemilix] = 1
  660.     ent_sentuh[pemilix] = 1
  661.     ent_sentuh_balik[pemilix] = 0
  662.     set_pev(Ent, pev_solid, SOLID_BBOX)
  663.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  664. }
  665.  
  666. public fw_SetModel(entity, model[])
  667. {
  668.     if(!pev_valid(entity))
  669.         return FMRES_IGNORED
  670.    
  671.     static Classname[64]
  672.     pev(entity, pev_classname, Classname, sizeof(Classname))
  673.    
  674.     if(!equal(Classname, "weaponbox"))
  675.         return FMRES_IGNORED
  676.    
  677.     static id
  678.     id = pev(entity, pev_owner)
  679.    
  680.     if(equal(model, old_w_model))
  681.     {
  682.         static weapon
  683.         weapon = fm_get_user_weapon_entity(entity, CSW_BDRIPPER)
  684.        
  685.         if(!pev_valid(weapon))
  686.             return FMRES_IGNORED
  687.        
  688.         if(g_had_guillotine[id])
  689.         {
  690.             set_pev(weapon, pev_impulse, WEAPON_SECRETCODE)
  691.             set_pev(weapon, pev_iuser4, g_guillotine_ammo[id])
  692.             engfunc(EngFunc_SetModel, entity, w_model)
  693.            
  694.             g_had_guillotine[id] = 0
  695.             g_guillotine_ammo[id] = 0
  696.            
  697.             return FMRES_SUPERCEDE
  698.         }
  699.     }
  700.  
  701.     return FMRES_IGNORED;
  702. }
  703.  
  704. public fw_AddToPlayer_Post(ent, id)
  705. {
  706.     if(pev(ent, pev_impulse) == WEAPON_SECRETCODE)
  707.     {
  708.         g_had_guillotine[id] = 1
  709.         g_guillotine_ammo[id] = pev(ent, pev_iuser4)
  710.        
  711.         set_pev(ent, pev_impulse, 0)
  712.     }          
  713.    
  714.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
  715.     write_string((g_had_guillotine[id] == 1 ? "weapon_guillotine" : "weapon_knife"))
  716.     write_byte(6)
  717.     write_byte(100)
  718.     write_byte(-1)
  719.     write_byte(-1)
  720.     write_byte(0)
  721.     write_byte(13)
  722.     write_byte(CSW_BDRIPPER)
  723.     write_byte(0)
  724.     message_end()
  725. }
  726.  
  727. public update_ammo(id)
  728. {
  729.     if(!is_user_alive(id))
  730.         return
  731.  
  732.     static weapon_ent; weapon_ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  733.     if(!pev_valid(weapon_ent)) return
  734.    
  735.     cs_set_weapon_ammo(weapon_ent, g_guillotine_ammo[id])  
  736.     cs_set_user_bpammo(id, CSW_BDRIPPER, g_guillotine_ammo[id])
  737.    
  738.     engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, get_user_msgid("CurWeapon"), {0, 0, 0}, id)
  739.     write_byte(1)
  740.     write_byte(CSW_BDRIPPER)
  741.     write_byte(-1)
  742.     message_end()
  743.    
  744.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("AmmoX"), _, id)
  745.     write_byte(1)
  746.     write_byte(g_guillotine_ammo[id])
  747.     message_end()
  748. }
  749.  
  750. public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id,ptr)
  751. {
  752.     if(!is_user_alive(id))
  753.         return HAM_IGNORED
  754.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  755.         return HAM_IGNORED
  756.  
  757.     // get crosshair aim
  758.     static Float:aim[3];
  759.     get_aim(id,v1,aim);
  760.    
  761.     // do another trace to this spot
  762.     new trace = create_tr2();
  763.     engfunc(EngFunc_TraceLine,v1,aim,noMonsters,id,trace);
  764.    
  765.     // copy ints
  766.     set_tr2(ptr,TR_AllSolid,get_tr2(trace,TR_AllSolid));
  767.     set_tr2(ptr,TR_StartSolid,get_tr2(trace,TR_StartSolid));
  768.     set_tr2(ptr,TR_InOpen,get_tr2(trace,TR_InOpen));
  769.     set_tr2(ptr,TR_InWater,get_tr2(trace,TR_InWater));
  770.     set_tr2(ptr,TR_pHit,get_tr2(trace,TR_pHit));
  771.     set_tr2(ptr,TR_iHitgroup,get_tr2(trace,TR_iHitgroup));
  772.  
  773.     // copy floats
  774.     get_tr2(trace,TR_flFraction,aim[0]);
  775.     set_tr2(ptr,TR_flFraction,aim[0]);
  776.     get_tr2(trace,TR_flPlaneDist,aim[0]);
  777.     set_tr2(ptr,TR_flPlaneDist,aim[0]);
  778.    
  779.     // copy vecs
  780.     get_tr2(trace,TR_vecEndPos,aim);
  781.     set_tr2(ptr,TR_vecEndPos,aim);
  782.     get_tr2(trace,TR_vecPlaneNormal,aim);
  783.     set_tr2(ptr,TR_vecPlaneNormal,aim);
  784.  
  785.     // get rid of new trace
  786.     free_tr2(trace);
  787.  
  788.     return FMRES_IGNORED;
  789. }
  790.  
  791. get_aim(id,Float:source[3],Float:ret[3])
  792. {
  793.     static Float:vAngle[3], Float:pAngle[3], Float:dir[3], Float:temp[3];
  794.  
  795.     // get aiming direction from forward global based on view angle and punch angle
  796.     pev(id,pev_v_angle,vAngle);
  797.     pev(id,pev_punchangle,pAngle);
  798.     xs_vec_add(vAngle,pAngle,temp);
  799.     engfunc(EngFunc_MakeVectors,temp);
  800.     global_get(glb_v_forward,dir);
  801.    
  802.     /* vecEnd = vecSrc + vecDir * flDistance; */
  803.     xs_vec_mul_scalar(dir,8192.0,temp);
  804.     xs_vec_add(source,temp,ret);
  805. }
  806.  
  807. public fake_smokes(Float:Origin[3])
  808. {
  809.     static TE_FLAG
  810.    
  811.     TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
  812.     TE_FLAG |= TE_EXPLFLAG_NOSOUND
  813.     TE_FLAG |= TE_EXPLFLAG_NOPARTICLES
  814.    
  815.     engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, Origin, 0)
  816.     write_byte(TE_EXPLOSION)
  817.     engfunc(EngFunc_WriteCoord, Origin[0])
  818.     engfunc(EngFunc_WriteCoord, Origin[1])
  819.     engfunc(EngFunc_WriteCoord, Origin[2])
  820.     write_short(g_smokepuff_id)
  821.     write_byte(6)
  822.     write_byte(25)
  823.     write_byte(TE_FLAG)
  824.     message_end()
  825. }
  826.  
  827. stock set_weapon_anim(id, anim)
  828. {
  829.     if(!is_user_alive(id))
  830.         return
  831.    
  832.     set_pev(id, pev_weaponanim, anim)
  833.    
  834.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id)
  835.     write_byte(anim)
  836.     write_byte(pev(id, pev_body))
  837.     message_end()
  838. }
  839.  
  840. stock kill(k, v, headshot)
  841. {
  842.     cs_set_user_money(k, cs_get_user_money(k) + 500)
  843.    
  844.     set_user_frags(k, get_user_frags(k) + 1)
  845.    
  846.     set_msg_block(g_MsgDeathMsg,BLOCK_ONCE)
  847.     set_msg_block(gmsgScoreInfo,BLOCK_ONCE)
  848.     user_kill(v,1)
  849.    
  850.     new kteam = get_user_team(k);
  851.     new vteam = get_user_team(v);
  852.    
  853.     new kfrags = get_user_frags(k);
  854.     new kdeaths = get_user_deaths(k);
  855.    
  856.     new vfrags = get_user_frags(v);
  857.     new vdeaths = get_user_deaths(v);
  858.    
  859.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  860.     ewrite_byte(k);
  861.     ewrite_short(kfrags);
  862.     ewrite_short(kdeaths);
  863.     ewrite_short(0);
  864.     ewrite_short(kteam);
  865.     emessage_end();
  866.    
  867.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  868.     ewrite_byte(v);
  869.     ewrite_short(vfrags);
  870.     ewrite_short(vdeaths);
  871.     ewrite_short(0);
  872.     ewrite_short(vteam);
  873.     emessage_end();
  874.    
  875.     emessage_begin(MSG_BROADCAST, g_MsgDeathMsg)
  876.     ewrite_byte(k)
  877.     ewrite_byte(v)
  878.     ewrite_byte(headshot)
  879.     ewrite_string("Blood Dripper")
  880.     emessage_end()
  881. }
  882.  
  883.  
  884. stock create_blood(const Float:origin[3])
  885. {
  886.     // Show some blood :)
  887.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  888.     write_byte(TE_BLOODSPRITE)
  889.     engfunc(EngFunc_WriteCoord, origin[0])
  890.     engfunc(EngFunc_WriteCoord, origin[1])
  891.     engfunc(EngFunc_WriteCoord, origin[2])
  892.     write_short(m_iBlood[1])
  893.     write_short(m_iBlood[0])
  894.     write_byte(75)
  895.     write_byte(8)
  896.     message_end()
  897. }
  898.  
  899. stock drop_weapons(id, dropwhat)
  900. {
  901.     static weapons[32], num, i, weaponid
  902.     num = 0
  903.     get_user_weapons(id, weapons, num)
  904.      
  905.     for (i = 0; i < num; i++)
  906.     {
  907.         weaponid = weapons[i]
  908.          
  909.         if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
  910.         {
  911.             static wname[32]
  912.             get_weaponname(weaponid, wname, sizeof wname - 1)
  913.             engclient_cmd(id, "drop", wname)
  914.         }
  915.     }
  916. }
  917.  
  918. stock Get_MissileWeaponHitGroup( iEnt )
  919. {
  920.     new Float:flStart[ 3 ], Float:flEnd[ 3 ];
  921.    
  922.     pev( iEnt, pev_origin, flStart );
  923.     pev( iEnt, pev_velocity, flEnd );
  924.     xs_vec_add( flStart, flEnd, flEnd );
  925.    
  926.     new ptr = create_tr2();
  927.     engfunc( EngFunc_TraceLine, flStart, flEnd, 0, iEnt, ptr );
  928.    
  929.     new iHitGroup, Owner, nOhead, head
  930.     Owner = pev(iEnt, pev_iuser1)
  931.     nOhead = get_tr2( ptr, TR_iHitgroup )
  932.     head = set_tr2( ptr, TR_iHitgroup, HIT_HEAD )
  933.    
  934.     iHitGroup = headshot_mode[Owner] ? head : nOhead
  935.    
  936.     free_tr2( ptr );
  937.    
  938.     return iHitGroup;
  939. }
  940.  
  941. stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
  942. {
  943.     new_velocity[0] = origin2[0] - origin1[0]
  944.     new_velocity[1] = origin2[1] - origin1[1]
  945.     new_velocity[2] = origin2[2] - origin1[2]
  946.     static Float:num; num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
  947.     new_velocity[0] *= num
  948.     new_velocity[1] *= num
  949.     new_velocity[2] *= num
  950.    
  951.     return 1;
  952. }
  953.  
  954. stock get_position(id,Float:forw, Float:right, Float:up, Float:vStart[])
  955. {
  956.     static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
  957.    
  958.     pev(id, pev_origin, vOrigin)
  959.     pev(id, pev_view_ofs, vUp) //for player
  960.     xs_vec_add(vOrigin, vUp, vOrigin)
  961.     pev(id, pev_v_angle, vAngle) // if normal entity ,use pev_angles
  962.    
  963.     angle_vector(vAngle, ANGLEVECTOR_FORWARD, vForward) //or use EngFunc_AngleVectors
  964.     angle_vector(vAngle, ANGLEVECTOR_RIGHT, vRight)
  965.     angle_vector(vAngle, ANGLEVECTOR_UP, vUp)
  966.    
  967.     vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up
  968.     vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up
  969.     vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up
  970. }
  971.  
  972. stock set_weapons_timeidle(id, WeaponId ,Float:TimeIdle)
  973. {
  974.     if(!is_user_alive(id))
  975.         return
  976.        
  977.     static entwpn; entwpn = fm_get_user_weapon_entity(id, WeaponId)
  978.     if(!pev_valid(entwpn))
  979.         return
  980.        
  981.     set_pdata_float(entwpn, 48, TimeIdle + 0.2, OFFSET_LINUX_WEAPONS)
  982. }
  983.  
  984. stock set_player_nextattackx(id, Float:nexttime)
  985. {
  986.     if(!is_user_alive(id))
  987.         return
  988.        
  989.     set_pdata_float(id, 83, nexttime, 5)
  990. }
  991.  
Error :-
  1. L 09/15/2021 - 13:45:34: [CSTRIKE] Invalid weapon id 29
  2.  
  3. L 09/15/2021 - 13:45:34: [AMXX] Run time error 10 (plugin "ze_vip_gulliton.amxx") (native "cs_set_user_bpammo") - debug not enabled!
  4.  
  5. L 09/15/2021 - 13:45:34: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
  6.  
  7. L 09/15/2021 - 13:45:34: [CSTRIKE] Invalid weapon id 29
  8.  
  9. L 09/15/2021 - 13:45:34: [AMXX] Run time error 10 (plugin "ze_vip_gulliton.amxx") (native "cs_set_user_bpammo") - debug not enabled!
  10.  
  11. L 09/15/2021 - 13:45:34: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).


Also I wanna remove it from extra items
Image
Image

User avatar
Evillious Energy
Member
Member
Nepal
Posts: 21
Joined: 1 Year Ago
Has thanked: 3 times
Been thanked: 2 times
Contact:

#4

Post by Evillious Energy » 1 Month Ago

VicKy wrote:
1 Month Ago
I Tried This One !!
Got Error

Code :-
  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <fakemeta_util>
  4. #include <cstrike>
  5. #include <fun>
  6. #include <amxmodx>
  7.  
  8. #define PLUGIN "Blood-Dripper"
  9. #define VERSION "1.0"
  10. #define AUTHOR "m4m3ts"
  11.  
  12. #define CSW_BDRIPPER CSW_KNIFE
  13. #define weapon_guillotine "weapon_knife"
  14. #define old_event "events/mac10.sc"
  15. #define old_w_model "models/w_mac10.mdl"
  16. #define WEAPON_SECRETCODE 1329419
  17.  
  18.  
  19. #define DEFAULT_AMMO 100
  20. #define DAMAGE 50
  21. #define BDRIP_CLASSNAME "Blood Dripper"
  22. #define WEAPON_ANIMEXT "knife"
  23.  
  24. #define Get_Ent_Data(%1,%2) get_pdata_int(%1,%2,4)
  25. #define Set_Ent_Data(%1,%2,%3) set_pdata_int(%1,%2,%3,4)
  26.  
  27. const PDATA_SAFE = 2
  28. const OFFSET_LINUX_WEAPONS = 4
  29. const OFFSET_WEAPONOWNER = 41
  30.  
  31. new const v_model[] = "models/FuriX/v_guillotine_furix_v3.mdl"
  32. new const p_model[] = "models/zombie_escape/p_guillotine.mdl"
  33. new const w_model[] = "models/zombie_escape/w_guillotine.mdl"
  34. new const KNIFE_MODEL[] = "models/zombie_escape/guillotine_projectile.mdl"
  35. new const PECAH_MODEL[] = "models/zombie_escape/gibs_guilotine.mdl"
  36. new const hit_wall[] = "weapons/janus9_stone1.wav"
  37. new const hit_wall2[] = "weapons/janus9_stone2.wav"
  38. new const weapon_sound[6][] =
  39. {
  40.     "weapons/guillotine_catch2.wav",
  41.     "weapons/guillotine_draw.wav",
  42.     "weapons/guillotine_draw_empty.wav",
  43.     "weapons/guillotine_explode.wav",
  44.     "weapons/guillotine_red.wav",
  45.     "weapons/guillotine-1.wav"
  46. }
  47.  
  48.  
  49. new const WeaponResource[3][] =
  50. {
  51.     "sprites/weapon_guillotine.txt",
  52.     "sprites/640hud120.spr",
  53.     "sprites/guillotine_lost.spr"
  54. }
  55.  
  56. enum
  57. {
  58.     ANIM_IDLE = 0,
  59.     ANIM_IDLE_EMPTY,
  60.     ANIM_SHOOT,
  61.     ANIM_DRAW,
  62.     ANIM_DRAW_EMPTY,
  63.     ANIM_IDLE_SHOOT,
  64.     ANIM_IDLE_SHOOT2,
  65.     ANIM_CATCH,
  66.     ANIM_LOST
  67. }
  68.  
  69. new g_MsgDeathMsg
  70.  
  71. new g_had_guillotine[33], g_guillotine_ammo[33], shoot_mode[33], shoot_ent_mode[33], g_pecah, headshot_mode[33], ent_sentuh[33], ent_sentuh_balik[33]
  72. new g_old_weapon[33], g_smokepuff_id, m_iBlood[2], guillotine_korban[33], headshot_korban[33], gmsgScoreInfo
  73. new g_iItemID
  74.  
  75. const PRIMARY_WEAPONS_BIT_SUM =
  76. (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
  77. CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
  78.  
  79. public plugin_init()
  80. {
  81.     register_plugin(PLUGIN, VERSION, AUTHOR)
  82.     register_cvar("guillotine_version", "m4m3ts", FCVAR_SERVER|FCVAR_SPONLY)
  83.     register_forward(FM_CmdStart, "fw_CmdStart")
  84.     register_forward(FM_SetModel, "fw_SetModel")
  85.     register_think(BDRIP_CLASSNAME, "fw_Think")
  86.     register_touch(BDRIP_CLASSNAME, "*", "fw_touch")
  87.     register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
  88.     register_forward(FM_TraceLine, "fw_traceline", 1)
  89.     register_forward(FM_AddToFullPack, "fm_addtofullpack_post", 1)
  90.     RegisterHam(Ham_Weapon_WeaponIdle, weapon_guillotine, "fw_guillotineidleanim", 1)
  91.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  92.     RegisterHam(Ham_Item_AddToPlayer, weapon_guillotine, "fw_AddToPlayer_Post", 1)
  93.     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  94.    
  95.    
  96.     register_clcmd("weapon_guillotine", "hook_weapon")
  97.     g_iItemID = ze_register_item("Gulliton", 250, 1)
  98.     ze_set_item_vip(g_iItemID, "VIP_F")
  99.  
  100.    
  101.     g_MsgDeathMsg = get_user_msgid("DeathMsg")
  102.     gmsgScoreInfo = get_user_msgid("ScoreInfo")
  103. }
  104.  
  105.  
  106. public plugin_precache()
  107. {
  108.     precache_model(v_model)
  109.     precache_model(p_model)
  110.     precache_model(w_model)
  111.     precache_model(KNIFE_MODEL)
  112.     g_pecah = precache_model(PECAH_MODEL)
  113.     precache_sound(hit_wall)
  114.     precache_sound(hit_wall2)
  115.    
  116.     for(new i = 0; i < sizeof(weapon_sound); i++)
  117.         precache_sound(weapon_sound[i])
  118.    
  119.     for(new i = 1; i < sizeof(WeaponResource); i++)
  120.         precache_model(WeaponResource[i])
  121.    
  122.     g_smokepuff_id = engfunc(EngFunc_PrecacheModel, WeaponResource[2])
  123.     m_iBlood[0] = precache_model("sprites/blood.spr")
  124.     m_iBlood[1] = precache_model("sprites/bloodspray.spr")
  125. }
  126. /*
  127. public ze_game_started_pre()
  128. {
  129.        if (get_user_flags(id) & ADMIN_LEVEL_G)
  130.         {
  131.           get_guillotine(id)
  132.         }  
  133.     }  
  134.  
  135. /*    
  136. public get_blood(id)
  137. {
  138.        if(!is_user_alive(id))
  139.             return
  140.  
  141.         g_had_guillotine[id] = 1
  142.         g_guillotine_ammo[id] = 9999
  143.         give_item(id, weapon_guillotine)
  144.         update_ammo(id)
  145.         //static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_guillotine, id)
  146.         //if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  147.     }
  148.  */    
  149. public plugin_natives()
  150. {
  151.     register_native("has_guillotine", "native_has_guillotine", 1)
  152.     register_native("give_guillotine", "native_give_guillotine", 1)
  153.     register_native("remove_guillotine", "native_remove_guillotine", 1)
  154. }
  155.  
  156. public native_has_guillotine(id)
  157. {
  158.     return g_had_guillotine[id]
  159. }
  160.  
  161. public native_give_guillotine(id)
  162. {
  163.     get_guillotine(id)
  164. }
  165.  
  166. public native_remove_guillotine(id)
  167. {
  168.     remove_guillotine(id)
  169. }
  170.  
  171. public ze_user_infected(id)
  172. {
  173.     remove_guillotine(id)
  174. }
  175.  
  176. public fw_PlayerKilled(id)
  177. {
  178.     remove_guillotine(id)
  179. }
  180.  
  181. public hook_weapon(id)
  182. {
  183.     engclient_cmd(id, weapon_guillotine)
  184.     return
  185. }
  186.  
  187. public ze_select_item_pre(id, itemid)
  188. {
  189.     // This not our item?
  190.     if (itemid != g_iItemID)
  191.         return ZE_ITEM_AVAILABLE
  192.    
  193.     // Available for Humans only, So don't show it for zombies
  194.     if (ze_is_user_zombie(id))
  195.         return ZE_ITEM_DONT_SHOW
  196.    
  197.     // Finally return that it's available
  198.     return ZE_ITEM_AVAILABLE
  199. }
  200.  
  201. public ze_select_item_post(id, itemid)
  202. {
  203.     // This is not our item, Block it here and don't execute the blew code
  204.     if (itemid != g_iItemID)
  205.         return
  206.    
  207.     get_guillotine(id)
  208. }
  209.  
  210. public get_guillotine(id)
  211. {
  212.     if(!is_user_alive(id))
  213.         return
  214.    // drop_weapons(id, 1)
  215.     g_had_guillotine[id] = 1
  216.     g_guillotine_ammo[id] = 100
  217.    
  218.     give_item(id, weapon_guillotine)
  219.     update_ammo(id)
  220.    
  221.     static weapon_ent; weapon_ent = fm_find_ent_by_owner(-1, weapon_guillotine, id)
  222.     if(pev_valid(weapon_ent)) cs_set_weapon_ammo(weapon_ent, 1)
  223. }
  224.  
  225. public remove_guillotine(id)
  226. {
  227.     g_had_guillotine[id] = 0
  228. }
  229.  
  230. public refill_guillotine(id)
  231. {  
  232.     if(g_had_guillotine[id]) g_guillotine_ammo[id] = 15
  233.    
  234.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id]) update_ammo(id)
  235. }
  236.    
  237. public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
  238. {
  239.     if(!is_user_alive(id) || !is_user_connected(id))
  240.         return FMRES_IGNORED  
  241.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  242.         set_cd(cd_handle, CD_flNextAttack, get_gametime() + 0.001)
  243.    
  244.     return FMRES_HANDLED
  245. }
  246.  
  247. public Event_CurWeapon(id)
  248. {
  249.     if(!is_user_alive(id))
  250.         return
  251.        
  252.     if(get_user_weapon(id) == CSW_BDRIPPER && g_had_guillotine[id])
  253.     {
  254.         set_pev(id, pev_viewmodel2, v_model)
  255.         set_pev(id, pev_weaponmodel2, p_model)
  256.         set_pdata_string(id, 492 * 4, WEAPON_ANIMEXT, -1 , 20)
  257.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] >= 1) set_weapon_anim(id, ANIM_DRAW)
  258.         if(g_old_weapon[id] != CSW_BDRIPPER && g_guillotine_ammo[id] == 0) set_weapon_anim(id, ANIM_DRAW_EMPTY)
  259.         update_ammo(id)
  260.     }
  261.    
  262.     g_old_weapon[id] = get_user_weapon(id)
  263. }
  264.  
  265. public fw_guillotineidleanim(knife)
  266. {
  267.     new id = get_pdata_cbase(knife, 41, 4)
  268.  
  269.     if(!is_user_alive(id) || ze_is_user_zombie(id) || !g_had_guillotine[id] || get_user_weapon(id) != CSW_BDRIPPER)
  270.         return HAM_IGNORED;
  271.    
  272.     if(shoot_mode[id] == 0 && g_guillotine_ammo[id] >= 1)
  273.         return HAM_SUPERCEDE;
  274.    
  275.     if(headshot_mode[id] == 0 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  276.     {
  277.         set_weapon_anim(id, ANIM_IDLE_SHOOT)
  278.         set_pdata_float(knife, 48, 20.0, 4)
  279.         return HAM_SUPERCEDE;
  280.     }
  281.    
  282.     if(headshot_mode[id] == 1 && shoot_mode[id] == 1 && get_pdata_float(knife, 48, 4) <= 0.25)
  283.     {
  284.         set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  285.         set_pdata_float(knife, 48, 20.0, 4)
  286.         return HAM_SUPERCEDE;
  287.     }
  288.    
  289.     if(g_guillotine_ammo[id] == 0 && get_pdata_float(knife, 48, 4) <= 0.25)
  290.     {
  291.         set_weapon_anim(id, ANIM_IDLE_EMPTY)
  292.         set_pdata_float(knife, 48, 20.0, 4)
  293.         return HAM_SUPERCEDE;
  294.     }
  295.  
  296.     return HAM_IGNORED;
  297. }
  298.  
  299. public fw_CmdStart(id, uc_handle, seed)
  300. {
  301.     if(!is_user_alive(id) || !is_user_connected(id))
  302.         return
  303.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  304.         return
  305.    
  306.     static ent; ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  307.     if(!pev_valid(ent))
  308.         return
  309.     if(get_pdata_float(ent, 46, OFFSET_LINUX_WEAPONS) > 0.0 || get_pdata_float(ent, 47, OFFSET_LINUX_WEAPONS) > 0.0)
  310.         return
  311.    
  312.     static CurButton
  313.     CurButton = get_uc(uc_handle, UC_Buttons)
  314.    
  315.     if(CurButton & IN_ATTACK)
  316.     {
  317.         CurButton &= ~IN_ATTACK
  318.         set_uc(uc_handle, UC_Buttons, CurButton)
  319.        
  320.         if(g_guillotine_ammo[id] == 0)
  321.             return
  322.         if(shoot_mode[id] == 0 && get_pdata_float(id, 83, 5) <= 0.0)
  323.         {
  324.             g_guillotine_ammo[id]--
  325.             update_ammo(id)
  326.             shoot_mode[id] = 1
  327.             FireKnife(id)
  328.             set_weapon_anim(id, ANIM_SHOOT)
  329.             emit_sound(id, CHAN_WEAPON, weapon_sound[5], 1.0, ATTN_NORM, 0, PITCH_NORM)
  330.             set_weapons_timeidle(id, CSW_BDRIPPER, 0.7)
  331.             set_player_nextattackx(id, 0.7)
  332.         }
  333.     }
  334. }
  335.  
  336. public FireKnife(id)
  337. {
  338.     static Float:StartOrigin[3], Float:velocity[3], Float:angles[3], Float:anglestrue[3], Float:jarak_max[3]
  339.     get_position(id, 2.0, 0.0, 0.0, StartOrigin)
  340.     get_position(id, 700.0, 0.0, 0.0, jarak_max)
  341.    
  342.     pev(id,pev_v_angle,angles)
  343.     static Ent; Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  344.     if(!pev_valid(Ent)) return
  345.     anglestrue[0] = 360.0 - angles[0]
  346.     anglestrue[1] = angles[1]
  347.     anglestrue[2] = angles[2]
  348.    
  349.     // Set info for ent
  350.     set_pev(Ent, pev_movetype, MOVETYPE_FLY)
  351.     set_pev(Ent, pev_owner, id)
  352.     set_pev(Ent, pev_iuser1, id)
  353.     set_pev(Ent, pev_fuser1, get_gametime() + 4.0)
  354.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  355.    
  356.     entity_set_string(Ent, EV_SZ_classname, BDRIP_CLASSNAME)
  357.     engfunc(EngFunc_SetModel, Ent, KNIFE_MODEL)
  358.     set_pev(Ent, pev_mins, Float:{-1.0, -1.0, -1.0})
  359.     set_pev(Ent, pev_maxs, Float:{1.0, 1.0, 1.0})
  360.     set_pev(Ent, pev_origin, StartOrigin)
  361.     set_pev(Ent, pev_angles, anglestrue)
  362.     set_pev(Ent, pev_gravity, 0.01)
  363.     set_pev(Ent, pev_solid, SOLID_BBOX)
  364.     set_pev(Ent, pev_frame, 1.0)
  365.     set_pev(Ent, pev_framerate, 30.0)
  366.     set_pev(Ent, pev_sequence, 0)
  367.    
  368.     velocity_by_aim( id, 1100, velocity )
  369.     set_pev( Ent, pev_velocity, velocity )
  370.     set_pev(Ent, pev_vuser1, velocity)
  371.     set_pev(Ent, pev_vuser2, jarak_max)
  372.     shoot_ent_mode[id] = 0
  373.     ent_sentuh[id] = 1
  374.     ent_sentuh_balik[id] = 0
  375. }
  376.  
  377. public fm_addtofullpack_post(es, e, user, host, host_flags, player, p_set)
  378. {
  379.     if(!player)
  380.         return FMRES_IGNORED
  381.        
  382.     if(!is_user_connected(host) || !is_user_alive(user))
  383.         return FMRES_IGNORED
  384.        
  385.     if(!ze_is_user_zombie(user) || headshot_korban[user] != 1)
  386.         return FMRES_IGNORED
  387.        
  388.     if(host == user)
  389.         return FMRES_IGNORED
  390.    
  391.     new Float:PlayerOrigin[3], Float:anglesss[3]
  392.     pev(user, pev_origin, PlayerOrigin)
  393.    
  394.     engfunc(EngFunc_GetBonePosition, user, 8, PlayerOrigin, anglesss)
  395.                        
  396.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  397.     engfunc(EngFunc_SetOrigin, guillotine_korban[user], PlayerOrigin)
  398.  
  399.     return FMRES_HANDLED
  400. }
  401.  
  402. public fw_Think(Ent)
  403. {
  404.     if(!pev_valid(Ent))
  405.         return
  406.    
  407.     static Float:pulang[3], Float:StartOriginz[3], pemilix, Float:brangkat[3], Float:jarak_max[3], Float:origin_asli[3], korban
  408.     pemilix = pev(Ent, pev_iuser1)
  409.     pev(Ent, pev_origin, StartOriginz)
  410.     korban = pev(Ent, pev_iuser2)
  411.    
  412.     if(headshot_korban[korban] == 1)
  413.     {
  414.         if(get_gametime() - 0.2 > pev(Ent, pev_fuser3))
  415.         {
  416.             Damage_guillotine(Ent, korban)
  417.             set_pev(Ent, pev_fuser3, get_gametime())
  418.         }
  419.     }
  420.    
  421.     if(ent_sentuh_balik[pemilix] == 0 && shoot_ent_mode[pemilix] == 1)
  422.     {
  423.         ent_sentuh_balik[pemilix] = 1
  424.         pev(pemilix, pev_origin, origin_asli)
  425.         origin_asli[2] += 7.5
  426.     }
  427.    
  428.     if(ent_sentuh[pemilix] == 1)
  429.     {
  430.         ent_sentuh[pemilix] = 0
  431.         pev(Ent, pev_vuser2, jarak_max)
  432.         pev(Ent, pev_vuser1, brangkat)
  433.         get_speed_vector(StartOriginz, origin_asli, 1100.0, pulang)
  434.                    
  435.         if(shoot_ent_mode[pemilix] == 1)
  436.         {
  437.             set_pev(Ent, pev_velocity, pulang)
  438.         }
  439.         else set_pev(Ent, pev_velocity, brangkat)
  440.     }
  441.    
  442.     if(shoot_ent_mode[pemilix] == 0 && get_distance_f(StartOriginz, jarak_max) <= 10.0)
  443.     {
  444.         shoot_ent_mode[pemilix] = 1
  445.         ent_sentuh[pemilix] = 1
  446.         set_pev(Ent, pev_owner, 0)
  447.     }
  448.    
  449.     if(shoot_ent_mode[pemilix] == 1 && get_distance_f(StartOriginz, origin_asli) <= 10.0)
  450.     {
  451.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  452.         else ancur(Ent)
  453.     }
  454.     else if(headshot_korban[korban] == 1) set_pev(Ent, pev_nextthink, get_gametime() + 0.2)
  455.     else set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  456. }
  457.  
  458. public fw_touch(Ent, Id)
  459. {
  460.     // If ent is valid
  461.     if(!pev_valid(Ent))
  462.         return
  463.     if(pev(Ent, pev_movetype) == MOVETYPE_NONE)
  464.         return
  465.     static classnameptd[32]
  466.     pev(Id, pev_classname, classnameptd, 31)
  467.     if (equali(classnameptd, "func_breakable")) ExecuteHamB( Ham_TakeDamage, Id, 0, 0, 80.0, DMG_GENERIC )
  468.    
  469.     // Get it's origin
  470.     new Float:originF[3], pemilix
  471.     pemilix = pev(Ent, pev_iuser1)
  472.     pev(Ent, pev_origin, originF)
  473.     // Alive...
  474.    
  475.     if(is_user_alive(Id) && ze_is_user_zombie(Id))
  476.     {
  477.         Damage_guillotine(Ent, Id)
  478.         set_pev(Ent, pev_owner, Id)
  479.         ent_sentuh[pemilix] = 1
  480.         create_blood(originF)
  481.         create_blood(originF)
  482.     }
  483.    
  484.     else if(shoot_ent_mode[pemilix] == 1 && Id == pemilix)
  485.     {
  486.         if(is_user_alive(pemilix) && is_user_connected(pemilix) && get_user_weapon(pemilix) == CSW_BDRIPPER && g_had_guillotine[pemilix]) balik(Ent)
  487.         else ancur(Ent)
  488.     }
  489.    
  490.     else if(is_user_alive(Id) && !ze_is_user_zombie(Id))
  491.     {
  492.         set_pev(Ent, pev_owner, Id)
  493.         ent_sentuh[pemilix] = 1
  494.     }
  495.    
  496.     else
  497.     {
  498.         set_pev(Ent, pev_owner, 0)
  499.  
  500.         if(shoot_ent_mode[pemilix] == 0)
  501.         {
  502.             shoot_ent_mode[pemilix] = 1
  503.             engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  504.             ent_sentuh[pemilix] = 1
  505.         }
  506.         else ancur(Ent)
  507.     }
  508. }
  509.  
  510. public ancur(Ent)
  511. {
  512.     if(!pev_valid(Ent))
  513.         return
  514.     static Float:origin2[3], pemilix, Float:origin3[3]
  515.     pemilix = pev(Ent, pev_iuser1)
  516.     entity_get_vector(Ent, EV_VEC_origin, origin2)
  517.     pev(Ent, pev_origin, origin3)
  518.    
  519.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin2, 0)
  520.     write_byte(TE_BREAKMODEL)
  521.     engfunc(EngFunc_WriteCoord, origin2[0])
  522.     engfunc(EngFunc_WriteCoord, origin2[1])
  523.     engfunc(EngFunc_WriteCoord, origin2[2])
  524.     engfunc(EngFunc_WriteCoord, 25)
  525.     engfunc(EngFunc_WriteCoord, 25)
  526.     engfunc(EngFunc_WriteCoord, 25)
  527.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  528.     engfunc(EngFunc_WriteCoord, random_num(-25, 25))
  529.     engfunc(EngFunc_WriteCoord, 5)
  530.     write_byte(5)
  531.     write_short(g_pecah)
  532.     write_byte(10)
  533.     write_byte(17)
  534.     write_byte(0x00)
  535.     message_end()
  536.    
  537.     fake_smokes(origin3)
  538.     engfunc(EngFunc_EmitSound, Ent, CHAN_WEAPON, hit_wall2, 1.0, ATTN_STATIC, 0, PITCH_NORM)
  539.     shoot_mode[pemilix] = 0
  540.     remove_entity(Ent)
  541.    
  542.     if(!is_user_alive(pemilix) || !is_user_connected(pemilix) || get_user_weapon(pemilix) != CSW_BDRIPPER || !g_had_guillotine[pemilix])
  543.         return
  544.    
  545.     set_weapon_anim(pemilix, ANIM_LOST)
  546.     set_weapons_timeidle(pemilix, CSW_BDRIPPER, 2.5)
  547.     set_player_nextattackx(pemilix, 2.5)
  548.     set_task(1.3, "reload2", pemilix)
  549.     set_task(1.4, "reload", pemilix)
  550. }
  551.  
  552. public reload(id)
  553. {
  554.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  555.         return
  556.    
  557.     set_weapon_anim(id, ANIM_DRAW)
  558. }
  559.  
  560. public reload2(id)
  561. {
  562.     if(!is_user_alive(id) || !is_user_connected(id) || get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id] || g_guillotine_ammo[id] == 0)
  563.         return
  564.    
  565.     set_weapon_anim(id, ANIM_IDLE_SHOOT2)
  566. }
  567.  
  568. public balik(Ent)
  569. {
  570.     if(!pev_valid(Ent))
  571.         return
  572.     static id
  573.     id = pev(Ent, pev_iuser1)
  574.     set_weapon_anim(id, ANIM_CATCH)
  575.     emit_sound(id, CHAN_WEAPON, weapon_sound[0], 1.0, ATTN_NORM, 0, PITCH_NORM)
  576.     set_weapons_timeidle(id, CSW_BDRIPPER, 1.0)
  577.     set_player_nextattackx(id, 1.0)
  578.     shoot_mode[id] = 0
  579.     g_guillotine_ammo[id]++
  580.     update_ammo(id)
  581.    
  582.     remove_entity(Ent)
  583. }
  584.  
  585. public Damage_guillotine(Ent, Id)
  586. {
  587.     static Owner; Owner = pev(Ent, pev_iuser1)
  588.     static Attacker;
  589.     if(!is_user_alive(Owner))
  590.     {
  591.         Attacker = 0
  592.         return
  593.     } else Attacker = Owner
  594.  
  595.     new bool:bIsHeadShot; // never make that one static
  596.     new Float:flAdjustedDamage, bool:death
  597.        
  598.     switch( Get_MissileWeaponHitGroup(Ent) )
  599.     {
  600.         case HIT_GENERIC: flAdjustedDamage = DAMAGE * 1.0
  601.         case HIT_STOMACH: flAdjustedDamage = DAMAGE * 1.2
  602.         case HIT_LEFTLEG, HIT_RIGHTLEG: flAdjustedDamage = DAMAGE * 1.0
  603.         case HIT_LEFTARM, HIT_RIGHTARM: flAdjustedDamage = DAMAGE * 1.0
  604.         case HIT_HEAD, HIT_CHEST:
  605.         {
  606.             flAdjustedDamage = DAMAGE * 3.0
  607.             bIsHeadShot = true
  608.             if(headshot_mode[Owner] == 0) set_task(2.0, "balik_bro", Ent+1858941 )
  609.             headshot_mode[Owner] = 1
  610.             headshot_korban[Id] = 1
  611.             guillotine_korban[Id] = Ent
  612.             set_pev(Ent, pev_iuser2, Id)
  613.             set_pev(Ent, pev_sequence, 1)
  614.             set_pev(Ent, pev_solid, SOLID_NOT)
  615.             set_pev(Ent, pev_fuser3, 0.0)
  616.         }
  617.     }
  618.     if(pev(Id, pev_health) <= flAdjustedDamage) death = true
  619.    
  620.     if(is_user_alive(Id))
  621.     {
  622.         if( bIsHeadShot && death)
  623.         {
  624.             if(task_exists( Ent+1858941 )) remove_task( Ent + 1858941 )
  625.             set_pev(Ent, pev_sequence, 0)
  626.             headshot_korban[pev(Ent, pev_iuser2)] = 0
  627.             headshot_mode[Owner] = 0
  628.             shoot_ent_mode[Owner] = 1
  629.             ent_sentuh[Owner] = 1
  630.             ent_sentuh_balik[Owner] = 0
  631.             set_pev(Ent, pev_solid, SOLID_BBOX)
  632.             set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  633.    
  634.             kill(Attacker, Id, 1)
  635.            
  636.             death = false          
  637.         }
  638.         if(death)
  639.         {
  640.             kill(Attacker, Id, 0)
  641.            
  642.             death = false          
  643.         }
  644.         else ExecuteHamB(Ham_TakeDamage, Id, Ent, Attacker, flAdjustedDamage, DMG_BULLET)
  645.     }
  646. }
  647.  
  648. public balik_bro(Ent)
  649. {
  650.     Ent -= 1858941
  651.    
  652.     if(!pev_valid(Ent))
  653.         return
  654.    
  655.     static pemilix; pemilix = pev(Ent, pev_iuser1)
  656.     set_pev(Ent, pev_sequence, 0)
  657.     headshot_korban[pev(Ent, pev_iuser2)] = 0
  658.     headshot_mode[pemilix] = 0
  659.     shoot_ent_mode[pemilix] = 1
  660.     ent_sentuh[pemilix] = 1
  661.     ent_sentuh_balik[pemilix] = 0
  662.     set_pev(Ent, pev_solid, SOLID_BBOX)
  663.     set_pev(Ent, pev_nextthink, halflife_time() + 0.01)
  664. }
  665.  
  666. public fw_SetModel(entity, model[])
  667. {
  668.     if(!pev_valid(entity))
  669.         return FMRES_IGNORED
  670.    
  671.     static Classname[64]
  672.     pev(entity, pev_classname, Classname, sizeof(Classname))
  673.    
  674.     if(!equal(Classname, "weaponbox"))
  675.         return FMRES_IGNORED
  676.    
  677.     static id
  678.     id = pev(entity, pev_owner)
  679.    
  680.     if(equal(model, old_w_model))
  681.     {
  682.         static weapon
  683.         weapon = fm_get_user_weapon_entity(entity, CSW_BDRIPPER)
  684.        
  685.         if(!pev_valid(weapon))
  686.             return FMRES_IGNORED
  687.        
  688.         if(g_had_guillotine[id])
  689.         {
  690.             set_pev(weapon, pev_impulse, WEAPON_SECRETCODE)
  691.             set_pev(weapon, pev_iuser4, g_guillotine_ammo[id])
  692.             engfunc(EngFunc_SetModel, entity, w_model)
  693.            
  694.             g_had_guillotine[id] = 0
  695.             g_guillotine_ammo[id] = 0
  696.            
  697.             return FMRES_SUPERCEDE
  698.         }
  699.     }
  700.  
  701.     return FMRES_IGNORED;
  702. }
  703.  
  704. public fw_AddToPlayer_Post(ent, id)
  705. {
  706.     if(pev(ent, pev_impulse) == WEAPON_SECRETCODE)
  707.     {
  708.         g_had_guillotine[id] = 1
  709.         g_guillotine_ammo[id] = pev(ent, pev_iuser4)
  710.        
  711.         set_pev(ent, pev_impulse, 0)
  712.     }          
  713.    
  714.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("WeaponList"), _, id)
  715.     write_string((g_had_guillotine[id] == 1 ? "weapon_guillotine" : "weapon_knife"))
  716.     write_byte(6)
  717.     write_byte(100)
  718.     write_byte(-1)
  719.     write_byte(-1)
  720.     write_byte(0)
  721.     write_byte(13)
  722.     write_byte(CSW_BDRIPPER)
  723.     write_byte(0)
  724.     message_end()
  725. }
  726.  
  727. public update_ammo(id)
  728. {
  729.     if(!is_user_alive(id))
  730.         return
  731.  
  732.     static weapon_ent; weapon_ent = fm_get_user_weapon_entity(id, CSW_BDRIPPER)
  733.     if(!pev_valid(weapon_ent)) return
  734.    
  735.     cs_set_weapon_ammo(weapon_ent, g_guillotine_ammo[id])  
  736.     cs_set_user_bpammo(id, CSW_BDRIPPER, g_guillotine_ammo[id])
  737.    
  738.     engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, get_user_msgid("CurWeapon"), {0, 0, 0}, id)
  739.     write_byte(1)
  740.     write_byte(CSW_BDRIPPER)
  741.     write_byte(-1)
  742.     message_end()
  743.    
  744.     message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("AmmoX"), _, id)
  745.     write_byte(1)
  746.     write_byte(g_guillotine_ammo[id])
  747.     message_end()
  748. }
  749.  
  750. public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id,ptr)
  751. {
  752.     if(!is_user_alive(id))
  753.         return HAM_IGNORED
  754.     if(get_user_weapon(id) != CSW_BDRIPPER || !g_had_guillotine[id])
  755.         return HAM_IGNORED
  756.  
  757.     // get crosshair aim
  758.     static Float:aim[3];
  759.     get_aim(id,v1,aim);
  760.    
  761.     // do another trace to this spot
  762.     new trace = create_tr2();
  763.     engfunc(EngFunc_TraceLine,v1,aim,noMonsters,id,trace);
  764.    
  765.     // copy ints
  766.     set_tr2(ptr,TR_AllSolid,get_tr2(trace,TR_AllSolid));
  767.     set_tr2(ptr,TR_StartSolid,get_tr2(trace,TR_StartSolid));
  768.     set_tr2(ptr,TR_InOpen,get_tr2(trace,TR_InOpen));
  769.     set_tr2(ptr,TR_InWater,get_tr2(trace,TR_InWater));
  770.     set_tr2(ptr,TR_pHit,get_tr2(trace,TR_pHit));
  771.     set_tr2(ptr,TR_iHitgroup,get_tr2(trace,TR_iHitgroup));
  772.  
  773.     // copy floats
  774.     get_tr2(trace,TR_flFraction,aim[0]);
  775.     set_tr2(ptr,TR_flFraction,aim[0]);
  776.     get_tr2(trace,TR_flPlaneDist,aim[0]);
  777.     set_tr2(ptr,TR_flPlaneDist,aim[0]);
  778.    
  779.     // copy vecs
  780.     get_tr2(trace,TR_vecEndPos,aim);
  781.     set_tr2(ptr,TR_vecEndPos,aim);
  782.     get_tr2(trace,TR_vecPlaneNormal,aim);
  783.     set_tr2(ptr,TR_vecPlaneNormal,aim);
  784.  
  785.     // get rid of new trace
  786.     free_tr2(trace);
  787.  
  788.     return FMRES_IGNORED;
  789. }
  790.  
  791. get_aim(id,Float:source[3],Float:ret[3])
  792. {
  793.     static Float:vAngle[3], Float:pAngle[3], Float:dir[3], Float:temp[3];
  794.  
  795.     // get aiming direction from forward global based on view angle and punch angle
  796.     pev(id,pev_v_angle,vAngle);
  797.     pev(id,pev_punchangle,pAngle);
  798.     xs_vec_add(vAngle,pAngle,temp);
  799.     engfunc(EngFunc_MakeVectors,temp);
  800.     global_get(glb_v_forward,dir);
  801.    
  802.     /* vecEnd = vecSrc + vecDir * flDistance; */
  803.     xs_vec_mul_scalar(dir,8192.0,temp);
  804.     xs_vec_add(source,temp,ret);
  805. }
  806.  
  807. public fake_smokes(Float:Origin[3])
  808. {
  809.     static TE_FLAG
  810.    
  811.     TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
  812.     TE_FLAG |= TE_EXPLFLAG_NOSOUND
  813.     TE_FLAG |= TE_EXPLFLAG_NOPARTICLES
  814.    
  815.     engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, Origin, 0)
  816.     write_byte(TE_EXPLOSION)
  817.     engfunc(EngFunc_WriteCoord, Origin[0])
  818.     engfunc(EngFunc_WriteCoord, Origin[1])
  819.     engfunc(EngFunc_WriteCoord, Origin[2])
  820.     write_short(g_smokepuff_id)
  821.     write_byte(6)
  822.     write_byte(25)
  823.     write_byte(TE_FLAG)
  824.     message_end()
  825. }
  826.  
  827. stock set_weapon_anim(id, anim)
  828. {
  829.     if(!is_user_alive(id))
  830.         return
  831.    
  832.     set_pev(id, pev_weaponanim, anim)
  833.    
  834.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id)
  835.     write_byte(anim)
  836.     write_byte(pev(id, pev_body))
  837.     message_end()
  838. }
  839.  
  840. stock kill(k, v, headshot)
  841. {
  842.     cs_set_user_money(k, cs_get_user_money(k) + 500)
  843.    
  844.     set_user_frags(k, get_user_frags(k) + 1)
  845.    
  846.     set_msg_block(g_MsgDeathMsg,BLOCK_ONCE)
  847.     set_msg_block(gmsgScoreInfo,BLOCK_ONCE)
  848.     user_kill(v,1)
  849.    
  850.     new kteam = get_user_team(k);
  851.     new vteam = get_user_team(v);
  852.    
  853.     new kfrags = get_user_frags(k);
  854.     new kdeaths = get_user_deaths(k);
  855.    
  856.     new vfrags = get_user_frags(v);
  857.     new vdeaths = get_user_deaths(v);
  858.    
  859.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  860.     ewrite_byte(k);
  861.     ewrite_short(kfrags);
  862.     ewrite_short(kdeaths);
  863.     ewrite_short(0);
  864.     ewrite_short(kteam);
  865.     emessage_end();
  866.    
  867.     emessage_begin(MSG_ALL, gmsgScoreInfo);
  868.     ewrite_byte(v);
  869.     ewrite_short(vfrags);
  870.     ewrite_short(vdeaths);
  871.     ewrite_short(0);
  872.     ewrite_short(vteam);
  873.     emessage_end();
  874.    
  875.     emessage_begin(MSG_BROADCAST, g_MsgDeathMsg)
  876.     ewrite_byte(k)
  877.     ewrite_byte(v)
  878.     ewrite_byte(headshot)
  879.     ewrite_string("Blood Dripper")
  880.     emessage_end()
  881. }
  882.  
  883.  
  884. stock create_blood(const Float:origin[3])
  885. {
  886.     // Show some blood :)
  887.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  888.     write_byte(TE_BLOODSPRITE)
  889.     engfunc(EngFunc_WriteCoord, origin[0])
  890.     engfunc(EngFunc_WriteCoord, origin[1])
  891.     engfunc(EngFunc_WriteCoord, origin[2])
  892.     write_short(m_iBlood[1])
  893.     write_short(m_iBlood[0])
  894.     write_byte(75)
  895.     write_byte(8)
  896.     message_end()
  897. }
  898.  
  899. stock drop_weapons(id, dropwhat)
  900. {
  901.     static weapons[32], num, i, weaponid
  902.     num = 0
  903.     get_user_weapons(id, weapons, num)
  904.      
  905.     for (i = 0; i < num; i++)
  906.     {
  907.         weaponid = weapons[i]
  908.          
  909.         if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
  910.         {
  911.             static wname[32]
  912.             get_weaponname(weaponid, wname, sizeof wname - 1)
  913.             engclient_cmd(id, "drop", wname)
  914.         }
  915.     }
  916. }
  917.  
  918. stock Get_MissileWeaponHitGroup( iEnt )
  919. {
  920.     new Float:flStart[ 3 ], Float:flEnd[ 3 ];
  921.    
  922.     pev( iEnt, pev_origin, flStart );
  923.     pev( iEnt, pev_velocity, flEnd );
  924.     xs_vec_add( flStart, flEnd, flEnd );
  925.    
  926.     new ptr = create_tr2();
  927.     engfunc( EngFunc_TraceLine, flStart, flEnd, 0, iEnt, ptr );
  928.    
  929.     new iHitGroup, Owner, nOhead, head
  930.     Owner = pev(iEnt, pev_iuser1)
  931.     nOhead = get_tr2( ptr, TR_iHitgroup )
  932.     head = set_tr2( ptr, TR_iHitgroup, HIT_HEAD )
  933.    
  934.     iHitGroup = headshot_mode[Owner] ? head : nOhead
  935.    
  936.     free_tr2( ptr );
  937.    
  938.     return iHitGroup;
  939. }
  940.  
  941. stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
  942. {
  943.     new_velocity[0] = origin2[0] - origin1[0]
  944.     new_velocity[1] = origin2[1] - origin1[1]
  945.     new_velocity[2] = origin2[2] - origin1[2]
  946.     static Float:num; num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
  947.     new_velocity[0] *= num
  948.     new_velocity[1] *= num
  949.     new_velocity[2] *= num
  950.    
  951.     return 1;
  952. }
  953.  
  954. stock get_position(id,Float:forw, Float:right, Float:up, Float:vStart[])
  955. {
  956.     static Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
  957.    
  958.     pev(id, pev_origin, vOrigin)
  959.     pev(id, pev_view_ofs, vUp) //for player
  960.     xs_vec_add(vOrigin, vUp, vOrigin)
  961.     pev(id, pev_v_angle, vAngle) // if normal entity ,use pev_angles
  962.    
  963.     angle_vector(vAngle, ANGLEVECTOR_FORWARD, vForward) //or use EngFunc_AngleVectors
  964.     angle_vector(vAngle, ANGLEVECTOR_RIGHT, vRight)
  965.     angle_vector(vAngle, ANGLEVECTOR_UP, vUp)
  966.    
  967.     vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up
  968.     vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up
  969.     vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up
  970. }
  971.  
  972. stock set_weapons_timeidle(id, WeaponId ,Float:TimeIdle)
  973. {
  974.     if(!is_user_alive(id))
  975.         return
  976.        
  977.     static entwpn; entwpn = fm_get_user_weapon_entity(id, WeaponId)
  978.     if(!pev_valid(entwpn))
  979.         return
  980.        
  981.     set_pdata_float(entwpn, 48, TimeIdle + 0.2, OFFSET_LINUX_WEAPONS)
  982. }
  983.  
  984. stock set_player_nextattackx(id, Float:nexttime)
  985. {
  986.     if(!is_user_alive(id))
  987.         return
  988.        
  989.     set_pdata_float(id, 83, nexttime, 5)
  990. }
  991.  
Error :-
  1. L 09/15/2021 - 13:45:34: [CSTRIKE] Invalid weapon id 29
  2.  
  3. L 09/15/2021 - 13:45:34: [AMXX] Run time error 10 (plugin "ze_vip_gulliton.amxx") (native "cs_set_user_bpammo") - debug not enabled!
  4.  
  5. L 09/15/2021 - 13:45:34: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
  6.  
  7. L 09/15/2021 - 13:45:34: [CSTRIKE] Invalid weapon id 29
  8.  
  9. L 09/15/2021 - 13:45:34: [AMXX] Run time error 10 (plugin "ze_vip_gulliton.amxx") (native "cs_set_user_bpammo") - debug not enabled!
  10.  
  11. L 09/15/2021 - 13:45:34: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).


Also I wanna remove it from extra items
Search for cs_set_user_bpammo and remove this native... since its no use cuz we have made guillotine knife.. since it is in code so plugin will execute this native also but our weapon is knife which dont contain bpammo or clip ammo.. so it cant add the ammo in guillotine and gives runtime error that not vaild weapon..
51.79.157.106:27017

VicKy
Mod Tester
Mod Tester
Pakistan
Posts: 82
Joined: 1 Year Ago
Has thanked: 14 times
Been thanked: 11 times
Age: 19
Contact:

#5

Post by VicKy » 1 Month Ago

Problem Solved !!
Image
Image

User avatar
Evillious Energy
Member
Member
Nepal
Posts: 21
Joined: 1 Year Ago
Has thanked: 3 times
Been thanked: 2 times
Contact:

#6

Post by Evillious Energy » 1 Month Ago

VicKy wrote:
1 Month Ago
Problem Solved !!
:v
These users thanked the author Evillious Energy for the post:
Z0uha1r_LK (1 Month Ago)
51.79.157.106:27017

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests