Approved Bunche of zombie classes

Gameplay Addons
User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

Bunche of zombie classes

#1

Post by Jack GamePlay » 4 Months Ago

| Description:
  • This is a pack of zombie classes which has nothing special but classical like in ZP (defaults).

| Code:
    1. #include <zombie_escape>
    2. #include <ze_zombie_class>
    3.  
    4. /*================================================================================
    5.  [Plugin Customization]
    6. =================================================================================*/
    7.  
    8. // Classic Zombie Attributes
    9. new const ZCLASS1_NAME[] =  "Classic Zombie"
    10. new const ZCLASS1_INFO[] =  "-=Balanced=-"
    11. const ZCLASS1_HEALTH = 2000
    12. const ZCLASS1_SPEED = 190
    13. const ZCLASS1_GRAVITY = 800
    14.  
    15. // Raptor Zombie Attributes
    16. new const ZCLASS2_NAME[] =  "Raptor Zombie"
    17. new const ZCLASS2_INFO[] =  "HP-- Speed++ Knockback++"
    18. const ZCLASS2_HEALTH = 1700
    19. const ZCLASS2_SPEED = 225
    20. const ZCLASS2_GRAVITY = 800
    21.  
    22. // Poison Zombie Attributes
    23. new const ZCLASS3_NAME[] = "Light Zombie"
    24. new const ZCLASS3_INFO[] = "HP- Jump+ Knockback+"
    25. const ZCLASS3_HEALTH = 1600
    26. const ZCLASS3_SPEED = 190
    27. const ZCLASS3_GRAVITY = 770
    28.  
    29. // Big Zombie Attributes
    30. new const ZCLASS4_NAME[] = "Big Zombie"
    31. new const ZCLASS4_INFO[] = "HP++ Speed- Knockback--"
    32. const ZCLASS4_HEALTH = 3000
    33. const ZCLASS4_SPEED = 155
    34. const ZCLASS4_GRAVITY = 800
    35.  
    36. // Leech Zombie Attributes
    37. new const ZCLASS5_NAME[] = "Leech Zombie"
    38. new const ZCLASS5_INFO[] = "HP- Knockback+ Leech++"
    39. const ZCLASS5_HEALTH = 1700
    40. const ZCLASS5_SPEED = 190
    41. const ZCLASS5_GRAVITY = 800
    42. const ZCLASS5_EXTRAHP = 500 // extra hp for infections
    43.  
    44. /*============================================================================*/
    45.  
    46. // Class IDs
    47. new g_iLeechClassID
    48.  
    49. public plugin_precache()
    50. {
    51.     register_plugin("[ZE] Addons: Default Zombie Classes", "1.0", "Jack GamePlay")
    52.    
    53.     ze_register_zombie_class(ZCLASS1_NAME, ZCLASS1_INFO, ZCLASS1_HEALTH, ZCLASS1_SPEED, ZCLASS1_GRAVITY)
    54.     ze_register_zombie_class(ZCLASS2_NAME, ZCLASS2_INFO, ZCLASS2_HEALTH, ZCLASS2_SPEED, ZCLASS2_GRAVITY)
    55.     ze_register_zombie_class(ZCLASS3_NAME, ZCLASS3_INFO, ZCLASS3_HEALTH, ZCLASS3_SPEED, ZCLASS3_GRAVITY)
    56.     ze_register_zombie_class(ZCLASS4_NAME, ZCLASS4_INFO, ZCLASS4_HEALTH, ZCLASS4_SPEED, ZCLASS4_GRAVITY)
    57.     g_iLeechClassID = ze_register_zombie_class(ZCLASS5_NAME, ZCLASS5_INFO, ZCLASS5_HEALTH, ZCLASS5_SPEED, ZCLASS5_GRAVITY)
    58. }
    59.  
    60. public ze_user_infected(id, iInfector)
    61. {
    62.     if (is_user_alive(iInfector) && ze_get_current_zombie_class(iInfector) == g_iLeechClassID)
    63.         set_entvar(iInfector, var_health, get_entvar(iInfector, var_health) + float(ZCLASS5_EXTRAHP))
    64. }
Image


User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#3

Post by Jack GamePlay » 4 Months Ago

Try:
  1. Spitter:
    1. /*
    2. *   ---------------------------------------------------------------------------------------------------------
    3. *   ------------------------------------[ZP] Zombie Class: Spitter (better)----------------------------------
    4. *   ---------------------------------------------------------------------------------------------------------
    5. *   ------------------------------------Author: SNAKER_BEATTER-----------------------------------------------
    6. *   ---------------------------------------------------------------------------------------------------------
    7. *               About:
    8. *       When i was using a special infected in L4D2 i was thinking about this class. Then i search first
    9. *       before creating because people may say its already created, but its created i found at a website.
    10. *       WELL THIS IS JUST A BETTER VERSION OF THAT SPITTER...
    11. *   ---------------------------------------------------------------------------------------------------------
    12. *               Description:
    13. *       This is another zombie class for zombie plague 4.3 or later. This zombie class is called spitter.
    14. *       She(this zombie class is female) can launch a spit/acid to an enemy. while the enemy will be damaged
    15. *       (according to spit's mode and a cvar) 25. And also as the better part when spitter die an acid
    16. *       ring will release at spitter's body, and when radiused(according to cvar) you will damaged (according-
    17. *       to a cvar)50...
    18. *
    19. *       Okay: in this version i removed the old buggy cooldown but i replaced it with a new better cooldown
    20. *       (according to cvar) and you must wait to spit again...
    21. *   ---------------------------------------------------------------------------------------------------------
    22. *               Credits:
    23. *       Hidanz + zombie-portal website - for the acual stupid spitter that use tank's code...
    24. *       mercylezz - i copied TE_BEAMCYLINDER message for the main death acid (code from zombie_plague40.sma)
    25. *   ---------------------------------------------------------------------------------------------------------
    26. *               Cvars:
    27. *       zp_Spitter_spit_speed 700 // spit Speed Launched by Spitter
    28. *       zp_Spitter_spit_damage 25 // damage done by the spit
    29. *       zp_Spitter_spit_reward 1 // Ammo Pack's Reward by touching the enemy with the spit
    30. *       zp_Spitter_spit_mode 1 // spit Mode / 1 = Take Damage / 2 = Killing / 3 = Infect
    31. *       zp_Spitter_spit_deal_damage 250 // Damage spitter when launch a spit / 0 = Kill spitter if lauched a spit
    32. *
    33. *       zp_Spitter_spit_cooldown 20 // (Only if defined BETTER_COOLDOWN) How many seconds spitter waits to spit again
    34. *
    35. *       zp_Spitter_death_acid_damage 50 // When spitter die. all players arounnd him will be damaged
    36. *       zp_Spitter_death_acid_distance 250 // Spitter death acid distance
    37. *   ----------------------------------------------------------------------------------------------------------
    38. *               Modules:
    39. *       hamsandwich
    40. *       fakemeta
    41. *       engine
    42. *       fun
    43. *   -----------------------------------------------------------------------------------------------------------
    44. *               Change log:
    45. *       1.0 (Oct 15, 2011)
    46. *       {
    47. *           public release.
    48. *       }
    49. *       1.1 (Oct 16, 2011)
    50. *       {
    51. *           Fix if spitter is human, death acid works
    52. *           Added spit/acid hit sound
    53. *       }
    54. *       1.2 (Oct 17, 2011)
    55. *       {
    56. *           Added bubbles when spit hit
    57. *           As remake added clcmd
    58. *           Fix if spitter is survivor, death acid works
    59. *           (best of all) Changed cooldown(buggy) to deal damage   
    60. *           Changed some resources names
    61. *       }
    62. *       1.3 (Oct 18, 2011)
    63. *       {
    64. *           Fix if spitter is nemesis, death acid works
    65. *           Added zombie support if spit hit zombie
    66. *           Added define SPIT_CHEAT_BLOCK for block some cheaty tricks
    67. *           Added colorchat when you lauched a spit
    68. *       }
    69. *       1.4 (Oct 23, 2011)
    70. *       {
    71. *           Changed when you launch a spit message mistype
    72. *           Removed if deal_damage cvar set to 0 kill spitter if launch a spit
    73. *       }
    74. *       1.5 (Oct 24, 2011)
    75. *       {
    76. *           (Asked) New cooldown better than the old buggy cooldown (Controlled by BETTER_COOLDOWN)
    77. *           (Asked) Added BETTER_COOLDOWN (define) to allow/disallow cooldown
    78. *           SPIT_CHEAT_BLOCK define more codes
    79. *           Added death acid bubble break
    80. *       }
    81. */
    82.  
    83. /******************************************************
    84.         [Include files]
    85. ******************************************************/
    86.  
    87. #include <zombie_escape>
    88. #include <ze_zombie_class>
    89. #include <fakemeta>
    90. #include <engine>
    91. #include <fun>
    92.  
    93. /******************************************************
    94.         [Plugin infos]
    95. ******************************************************/
    96.  
    97. #define PLUGIN_NAME "[ZE] ZCLASS = L4D spitter"
    98. #define PLUGIN_VERSION  "1.5"
    99. #define PLUGIN_AUTHOR   "snaker-beatter"
    100.  
    101. /******************************************************
    102.         [Id(s)]
    103. ******************************************************/
    104. #define SPIT_CHEAT_BLOCK    // Disallow some cheatty trick
    105. #define BETTER_COOLDOWN     // Than the old buggy cooldown this works more better
    106.  
    107. #if defined BETTER_COOLDOWN
    108.     new Float:g_LastSpitTime[33]
    109.     new cvar_spit_cooldown
    110. #endif
    111.  
    112. new const zclass_name[] = "Spitter"
    113. new const zclass_info[] = "Launch an acid"
    114. const zclass_health = 3422
    115. const zclass_speed = 267
    116. const zclass_gravity = 780
    117.  
    118. new g_L4dSpitter
    119.  
    120. new g_trailSprite
    121. new const g_trail[] = "sprites/xbeam3.spr"
    122. new const spit_model[] = "models/spit.mdl" // HAlF-Life model
    123. new const bubble_model_const[] = "sprites/bubble.spr"
    124. new const Spitter_spitlaunch[] = "zombie_plague/spitter_spit.wav"
    125. new const Spitter_spithit[] = "bullchicken/bc_spithit2.wav" // HAlF-Life model
    126.  
    127. new const Spitter_dieacid_start[] = "bullchicken/bc_acid1.wav"
    128. new const g_ringspr[] = "sprites/shockwave.spr"
    129. new g_ring, bubble_model
    130.  
    131. new cvar_spit_damage, cvar_spit_reward, cvar_spitmode, cvar_spit_speed, cvar_spit_deal_damage
    132. new cvar_dthacid_damage, cvar_dthacid_distance
    133.  
    134. /******************************************************
    135.         [Main event]
    136. ******************************************************/
    137.  
    138. public plugin_init()
    139. {
    140.     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
    141.     register_event("DeathMsg", "spitter_death", "a")
    142.  
    143.     cvar_spit_speed = register_cvar("zp_Spitter_spit_speed", "700")
    144.     cvar_spit_damage = register_cvar("zp_Spitter_spit_damage", "25")
    145.     cvar_spit_reward = register_cvar("zp_Spitter_spit_reward", "1")
    146.     cvar_spitmode = register_cvar("zp_Spitter_spit_mode", "1")
    147.     cvar_spit_deal_damage = register_cvar("zp_Spitter_spit_deal_damage", "250")
    148.    
    149. #if defined BETTER_COOLDOWN
    150.     cvar_spit_cooldown = register_cvar("zp_Spitter_spit_cooldown", "20")
    151. #endif
    152.  
    153.     cvar_dthacid_damage = register_cvar("zp_Spitter_death_acid_damage", "50")
    154.     cvar_dthacid_distance = register_cvar("zp_Spitter_death_acid_distance", "250")
    155.    
    156.     register_clcmd("spitter_spit", "clcmd_spit")
    157.     register_touch("spit_ent","*","spitTouch")
    158.     register_forward(FM_PlayerPreThink, "CmdStart")
    159. }
    160.  
    161. /****************************************************
    162.         [Events]
    163. ****************************************************/
    164.  
    165. public plugin_precache()
    166. {
    167.     g_L4dSpitter = ze_register_zombie_class(zclass_name, zclass_info, zclass_health, zclass_speed, zclass_gravity)
    168.     g_trailSprite = precache_model(g_trail)
    169.     g_ring = precache_model(g_ringspr)
    170.     bubble_model = precache_model(bubble_model_const)
    171.     precache_model(spit_model)
    172.     precache_sound(Spitter_spitlaunch)
    173.     precache_sound(Spitter_spithit)
    174.     precache_sound(Spitter_dieacid_start)
    175. }
    176.  
    177. public ze_user_infected(id)
    178. {
    179.     if (ze_get_current_zombie_class(id) == g_L4dSpitter)
    180.     {
    181.         ze_colored_print(id, "!gYou can launch a spit by +use key(such as e)")
    182.     }
    183. }  
    184.  
    185. public CmdStart(id)
    186. {      
    187.     new button = pev(id, pev_button)
    188.     new oldbutton = pev(id, pev_oldbuttons)
    189.    
    190.     if (ze_is_user_zombie(id) && (ze_get_current_zombie_class(id) == g_L4dSpitter))
    191.     {
    192.         if(oldbutton & IN_USE && !(button & IN_USE))
    193.         {
    194.             clcmd_spit(id)
    195.         }
    196.     }
    197.     return FMRES_IGNORED
    198. }
    199.  
    200. public clcmd_spit(id)
    201. {
    202.     if(!is_user_alive(id))
    203.     {
    204.         ze_colored_print(id, "You are not allowed to spit if you're death")
    205.         return PLUGIN_HANDLED
    206.     }
    207.    
    208.     if (ze_is_user_zombie(id) && ze_get_current_zombie_class(id) == g_L4dSpitter)
    209.     {
    210.         if (get_gametime() - g_LastSpitTime[id] < get_pcvar_float(cvar_spit_cooldown))
    211.         {
    212.             ze_colored_print(id, "You have to wait %.f0 secs. To spit again", get_pcvar_float(cvar_spit_cooldown) - (get_gametime() -  g_LastSpitTime[id]))
    213.             return PLUGIN_HANDLED;
    214.         }
    215.        
    216.         Makespit(id)
    217.         emit_sound(id, CHAN_STREAM, Spitter_spitlaunch, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    218.        
    219.         g_LastSpitTime[id] = get_gametime()
    220.        
    221.         new Float:dam = get_pcvar_float(cvar_spit_deal_damage);
    222.         if(get_user_health(id) - get_pcvar_float(cvar_spit_deal_damage) > 0)
    223.         {
    224.             #if defined SPIT_CHEAT_BLOCK
    225.                 fakedamage(id, "Spit acid", dam, 256);
    226.             #else
    227.                 fakedamage(id, "Spit acid", 10.0, 256);
    228.             #endif
    229.            
    230.             static origin1[3]
    231.             get_user_origin(id, origin1)
    232.             bubble_break(id, origin1)
    233.            
    234.             ze_colored_print(id, "You'd !tbeen damaged %d by launching a spit", get_pcvar_num(cvar_spit_deal_damage))
    235.         }
    236.     }
    237.     else
    238.     {
    239.         ze_colored_print(id, "You are not !tallowed to spit unless you're a zombie spitter")
    240.         return PLUGIN_HANDLED
    241.     }
    242.     return PLUGIN_CONTINUE
    243. }
    244.  
    245. public spitTouch(spitEnt, Touched)
    246. {
    247.     if (!pev_valid (spitEnt) )
    248.         return
    249.        
    250.     static Class[ 32 ]
    251.     entity_get_string(Touched, EV_SZ_classname, Class, charsmax(Class) )
    252.     new Float:origin[3]
    253.        
    254.     pev(Touched,pev_origin,origin)
    255.    
    256.     if(equal(Class, "player"))
    257.     {
    258.         if (is_user_alive(Touched))
    259.         {
    260.             if(!ze_is_user_zombie(Touched))
    261.             {
    262.                 new SpitterKiller = entity_get_edict(spitEnt, EV_ENT_owner)
    263.                
    264.                 switch(get_pcvar_num(cvar_spitmode))
    265.                 {
    266.                     case 1: // Health mode
    267.                     {
    268.                         new iHealth = get_user_health(Touched)
    269.  
    270.                         if(iHealth >= 1 && iHealth <= get_pcvar_num(cvar_spit_damage))
    271.                         {
    272.                             emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
    273.                             ExecuteHamB(Ham_Killed, Touched, SpitterKiller, 0)
    274.                             ze_colored_print(SpitterKiller, "You receive !t%d!y Ammo Packs By launching a spit to a human", get_pcvar_num(cvar_spit_reward))
    275.                             ze_set_escape_coins(SpitterKiller, ze_get_escape_coins(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
    276.                            
    277.                             static origin1[3]
    278.                             get_user_origin(Touched, origin1)
    279.                             bubble_break(Touched, origin1)
    280.                         }
    281.                         else
    282.                         {  
    283.                             emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
    284.                             set_user_health(Touched, get_user_health(Touched) - get_pcvar_num(cvar_spit_damage))
    285.                             ze_colored_print(SpitterKiller, "You receive !t%d!n Ammo Packs By launching a spit to a human", get_pcvar_num(cvar_spit_reward))
    286.                             ze_set_escape_coins(SpitterKiller, ze_get_escape_coins(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
    287.                            
    288.                             static origin1[3]
    289.                             get_user_origin(Touched, origin1)
    290.                             bubble_break(Touched, origin1)
    291.                         }
    292.                     }
    293.                     case 2: // Kill mode
    294.                     {  
    295.                         emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
    296.                         ExecuteHamB(Ham_Killed, Touched, SpitterKiller, 0)
    297.                         ze_set_escape_coins(SpitterKiller, ze_get_escape_coins(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
    298.                         ze_colored_print(SpitterKiller, "You receive !t%d!n Ammo Packs By launching a spit to a human", get_pcvar_num(cvar_spit_reward))
    299.                        
    300.                         static origin1[3]
    301.                         get_user_origin(Touched, origin1)
    302.                         bubble_break(Touched, origin1)
    303.                     }
    304.                     case 3: //infect mode
    305.                     {
    306.                         emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
    307.                         ze_set_user_zombie(Touched)
    308.                         ze_colored_print(SpitterKiller, "You receive !t%d!n Ammo Packs By launching a spit to a human", get_pcvar_num(cvar_spit_reward))
    309.                         ze_set_escape_coins(SpitterKiller, ze_get_escape_coins(SpitterKiller) + get_pcvar_num(cvar_spit_reward))
    310.                        
    311.                         static origin1[3]
    312.                         get_user_origin(Touched, origin1)
    313.                         bubble_break(Touched, origin1)
    314.                     }
    315.                 }
    316.             }
    317.             else
    318.             {
    319.                 emit_sound(Touched, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
    320.            
    321.                 static origin1[3]
    322.                 get_user_origin(Touched, origin1)
    323.                 bubble_break(Touched, origin1)
    324.                
    325.             }
    326.         }
    327.     }
    328.  
    329.     if(equal(Class, "func_breakable") && entity_get_int(Touched, EV_INT_solid) != SOLID_NOT)
    330.     {
    331.         force_use(spitEnt, Touched)
    332.     }
    333.    
    334.     remove_entity(spitEnt)
    335. }
    336.  
    337. public bubble_break(id, origin1[3])
    338. {
    339.     message_begin(MSG_BROADCAST,SVC_TEMPENTITY, origin1)
    340.     write_byte(TE_BREAKMODEL)
    341.     write_coord(origin1[0])  
    342.     write_coord(origin1[1])
    343.     write_coord(origin1[2] + 24)
    344.     write_coord(16)
    345.     write_coord(16)
    346.     write_coord(16)
    347.     write_coord(random_num(-50,50))
    348.     write_coord(random_num(-50,50))
    349.     write_coord(25)
    350.     write_byte(10)
    351.     write_short(bubble_model)
    352.     write_byte(10)
    353.     write_byte(38)
    354.     write_byte(0x01)
    355.     message_end();
    356. }
    357.  
    358. public Makespit(id)
    359. {          
    360.     new Float:Origin[3]
    361.     new Float:Velocity[3]
    362.     new Float:vAngle[3]
    363.  
    364.     new spitSpeed = get_pcvar_num(cvar_spit_speed)
    365.  
    366.     entity_get_vector(id, EV_VEC_origin , Origin)
    367.     entity_get_vector(id, EV_VEC_v_angle, vAngle)
    368.  
    369.     new NewEnt = create_entity("info_target")
    370.  
    371.     entity_set_string(NewEnt, EV_SZ_classname, "spit_ent")
    372.     entity_set_model(NewEnt, spit_model)
    373.     entity_set_size(NewEnt, Float:{-1.5, -1.5, -1.5}, Float:{1.5, 1.5, 1.5})
    374.     entity_set_origin(NewEnt, Origin)
    375.     entity_set_vector(NewEnt, EV_VEC_angles, vAngle)
    376.     entity_set_int(NewEnt, EV_INT_solid, 2)
    377.     entity_set_int(NewEnt, EV_INT_rendermode, 5)
    378.     entity_set_float(NewEnt, EV_FL_renderamt, 200.0)
    379.     entity_set_float(NewEnt, EV_FL_scale, 1.00)
    380.     entity_set_int(NewEnt, EV_INT_movetype, 5)
    381.     entity_set_edict(NewEnt, EV_ENT_owner, id)
    382.     velocity_by_aim(id, spitSpeed  , Velocity)
    383.     entity_set_vector(NewEnt, EV_VEC_velocity ,Velocity)
    384.    
    385.     spit_trail(id, NewEnt)
    386.     return PLUGIN_HANDLED
    387. }
    388.  
    389. public spit_trail(id, Entity)
    390. {
    391.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    392.     write_byte(TE_BEAMFOLLOW)
    393.     write_short(Entity)
    394.     write_short(g_trailSprite)
    395.     write_byte(10)
    396.     write_byte(10)
    397.     write_byte(0)
    398.     write_byte(250)
    399.     write_byte(0)
    400.     write_byte(200)
    401.     message_end()
    402. }
    403.  
    404. public spitter_death()
    405. {
    406.     new id = read_data(2)
    407.     if (ze_is_user_zombie(id))
    408.     {
    409.         if (ze_get_current_zombie_class(id) == g_L4dSpitter)
    410.         {
    411.             new Float:originF[3]
    412.             pev(id, pev_origin, originF);
    413.             spit_death(id, originF)
    414.         }
    415.     }
    416. }
    417.  
    418. public spit_death(id, const Float:originF[3])
    419. {
    420.     if (ze_is_user_zombie(id))
    421.     {
    422.         if (ze_get_current_zombie_class(id) == g_L4dSpitter)
    423.         {
    424.             spit_death_effect(id, originF)
    425.             ring_effect(id)
    426.         }
    427.     }
    428.     else
    429.     {
    430.         return PLUGIN_HANDLED
    431.     }
    432.  
    433.     return PLUGIN_HANDLED
    434. }
    435.  
    436. public ring_effect(id)
    437. {
    438.     new Float:origin[3]
    439.     pev(id, pev_origin, origin)
    440.     ring(origin)
    441. }
    442.  
    443. public spit_death_effect(id, const Float:originF[3])
    444. {
    445.     for(new i = 1; i <= get_maxplayers(); i ++)
    446.     {
    447.         if (ze_is_user_zombie(i) || get_entity_distance(id, i) > get_pcvar_num(cvar_dthacid_distance))
    448.         {
    449.             return PLUGIN_HANDLED
    450.         }
    451.         new origin1[3]
    452.         get_user_origin(id, origin1)
    453.         bubble_break(id, origin1)
    454.        
    455.         emit_sound(id, CHAN_BODY, Spitter_dieacid_start, 1.0, ATTN_NORM, 0, PITCH_NORM)
    456.         ze_colored_print(id, "You rewarded !t2 ammopacks by aciding to a victim")
    457.         ze_set_escape_coins(id, ze_get_escape_coins(id) + 2)
    458.        
    459.         new Float:dam = get_pcvar_float(cvar_dthacid_damage);
    460.         if(get_user_health(i) - get_pcvar_float(cvar_dthacid_damage) > 0)
    461.         {
    462.             emit_sound(i, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
    463.             ze_colored_print(i, "You'd been !tdamaged by spitter's death acid")
    464.             fakedamage(i, "Spit acid", dam, 256);
    465.            
    466.             new origin1[3]
    467.             get_user_origin(i, origin1)
    468.             bubble_break(i, origin1)
    469.         }
    470.         if(get_user_health(i) - get_pcvar_float(cvar_dthacid_damage) == 0)
    471.         {
    472.             #if defined SPIT_CHEAT_BLOCK
    473.                 ExecuteHamB(Ham_Killed, i, id, 0)
    474.             #else
    475.                 //ExecuteHamB(Ham_Killed, i, id, 0)
    476.             #endif
    477.             emit_sound(i, CHAN_BODY, Spitter_spithit, 1.0, ATTN_NORM, 0, PITCH_NORM)
    478.             ze_colored_print(i, "You'd been !tKilled by spitter's death acd")
    479.            
    480.             new origin1[3]
    481.             get_user_origin(i, origin1)
    482.             bubble_break(i, origin1)
    483.         }
    484.     }
    485.    
    486.     return PLUGIN_HANDLED
    487. }
    488.  
    489. public ring(const Float:originF[3])
    490. {
    491.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
    492.     write_byte(TE_BEAMCYLINDER) // TE id
    493.     engfunc(EngFunc_WriteCoord, originF[0]) // x
    494.     engfunc(EngFunc_WriteCoord, originF[1]) // y
    495.     engfunc(EngFunc_WriteCoord, originF[2]) // z
    496.     engfunc(EngFunc_WriteCoord, originF[0]) // x axis
    497.     engfunc(EngFunc_WriteCoord, originF[1]) // y axis
    498.     engfunc(EngFunc_WriteCoord, originF[2]+385.0) // z axis
    499.     write_short(g_ring) // sprite
    500.     write_byte(0) // startframe
    501.     write_byte(0) // framerate
    502.     write_byte(4) // life
    503.     write_byte(60) // width
    504.     write_byte(0) // noise
    505.     write_byte(0) // red
    506.     write_byte(200) // green
    507.     write_byte(0) // blue
    508.     write_byte(200) // brightness
    509.     write_byte(0) // speed
    510.     message_end()
    511. }]
  2. Brute Mother:
    1. #include <zombie_escape>
    2. #include <ze_zombie_class>
    3. #include <fakemeta>
    4.  
    5. /*================================================================================
    6.  [Constants, Offsets, Macros]
    7. =================================================================================*/
    8.  
    9. // Plugin Version
    10. new const PLUGIN_VERSION[] = "1.1.0"
    11.  
    12. // Brute Mother
    13. new const zclass_name[] = "Brute Mother"
    14. new const zclass_info[] = "=Balanced= Heal (hold +use)"
    15. const zclass_health = 1800
    16. const zclass_speed = 190
    17. const zclass_gravity = 800
    18.  
    19. /*================================================================================
    20.  [Global Variables]
    21. =================================================================================*/
    22.  
    23. // Player vars
    24. new g_bZombie[33] // whether player is zombie
    25. new g_bMother[33] // whether player is brute mother
    26. new g_bHealing[33] // whether player is healing
    27. new g_bInRange[33][33] // whether zombie is in range
    28. new Float:g_flMaxHealth[33] // zombie's max health
    29. new g_iHealCounter[33] // brute mother heal counter
    30.  
    31. // Game vars
    32. new g_iMotherIndex // index from the class
    33. new g_iMaxPlayers // max player counter
    34. new g_bHamCzBots // whether ham forwards are registered for CZ bots
    35.  
    36. // Cvar pointers
    37. new cvar_Interval, cvar_Amount, cvar_Range, cvar_Counter
    38.  
    39. // Healing Color
    40. new g_iColor[3] = { 0 , 150 , 0 }
    41.  
    42. // Player stuff
    43. new g_bIsAlive[33] // whether player is alive
    44. new g_bIsBot[33] // whether player is bot
    45.  
    46. // Macro
    47. #define is_user_valid_alive(%1) (1 <= %1 <= g_iMaxPlayers && g_bIsAlive[%1])
    48.  
    49. /*================================================================================
    50.  [Precache and Init]
    51. =================================================================================*/
    52.  
    53. public plugin_precache()
    54. {  
    55.     g_iMotherIndex = ze_register_zombie_class(zclass_name, zclass_info, zclass_health, zclass_speed, zclass_gravity)
    56. }
    57.  
    58. public plugin_init()
    59. {
    60.     register_plugin("[ZE] Class : Brute Mother", PLUGIN_VERSION, "schmurgel1983")
    61.    
    62.     RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn_Post", 1)
    63.     RegisterHam(Ham_Killed, "player", "fwd_PlayerKilled_Post", 1)
    64.    
    65.     register_forward(FM_PlayerPreThink, "fwd_PlayerPreThink")
    66.     register_forward(FM_AddToFullPack, "fwd_AddToFullPack_Post", 1)
    67.    
    68.     cvar_Interval = register_cvar("ze_mother_interval", "0.2")
    69.     cvar_Amount = register_cvar("ze_mother_amount", "10")
    70.     cvar_Range = register_cvar("ze_mother_range", "128")
    71.     cvar_Counter = register_cvar("ze_mother_counter", "200")
    72.    
    73.     register_cvar("Brute_Mother_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
    74.     set_cvar_string("Brute_Mother_version", PLUGIN_VERSION)
    75.    
    76.     g_iMaxPlayers = get_member_game(m_nMaxPlayers)
    77. }
    78.  
    79. public client_putinserver(id)
    80. {
    81.     remove_task(id)
    82.     set_cvars(id)
    83.    
    84.     if (is_user_bot(id))
    85.     {
    86.         g_bIsBot[id] = true
    87.        
    88.         if (!g_bHamCzBots)
    89.             set_task(0.1, "register_ham_czbots", id)
    90.     }
    91. }
    92.  
    93. public client_disconnected(id)
    94. {
    95.     remove_task(id)
    96.     set_cvars(id)
    97.     g_bIsBot[id] = false
    98. }
    99.  
    100. /*================================================================================
    101.  [Main Forwards]
    102. =================================================================================*/
    103.  
    104. public ze_roundend()
    105. {
    106.     for (new id = 1; id <= g_iMaxPlayers; id++)
    107.     {
    108.         remove_task(id)
    109.         set_cvars(id)
    110.     }
    111. }
    112.  
    113. public fwd_PlayerSpawn_Post(id)
    114. {
    115.     if (!is_user_alive(id) || !get_member(id, m_iTeam)) return
    116.    
    117.     g_bIsAlive[id] = true
    118. }
    119.  
    120. public fwd_PlayerKilled_Post(victim, attacker, gib)
    121. {
    122.     g_bIsAlive[victim] = false
    123.     remove_task(victim)
    124.     set_cvars(victim)
    125. }
    126.  
    127. public fwd_PlayerPreThink(id)
    128. {
    129.     if (!g_bMother[id] || !g_bIsAlive[id] || g_bIsBot[id]) return
    130.    
    131.     g_bHealing[id] = (pev(id, pev_button) & IN_USE) ? true : false;
    132. }
    133.  
    134. public fwd_AddToFullPack_Post(es_handle, e, ent, host, flags, player)
    135. {
    136.     if (!player || !g_bZombie[host] || !g_bZombie[ent]) return FMRES_IGNORED
    137.    
    138.     if (g_bHealing[host] && g_bInRange[host][ent] || g_bHealing[ent])
    139.     {
    140.         set_es(es_handle, ES_RenderFx, kRenderFxGlowShell)
    141.         set_es(es_handle, ES_RenderColor, g_iColor)
    142.         set_es(es_handle, ES_RenderAmt, 5)
    143.        
    144.         return FMRES_IGNORED
    145.     }
    146.     return FMRES_IGNORED
    147. }
    148.  
    149. public ze_user_infected(id)
    150. {
    151.     remove_task(id)
    152.     set_cvars(id)
    153.    
    154.     g_bZombie[id] = true
    155.     pev(id, pev_health, g_flMaxHealth[id])
    156.    
    157.     if (ze_get_current_zombie_class(id) == g_iMotherIndex)
    158.     {
    159.         g_bMother[id] = true
    160.         set_task(get_pcvar_float(cvar_Interval), "Mother_Heal", id, _, _, "b")
    161.        
    162.         if (g_bIsBot[id])
    163.             g_bHealing[id] = true
    164.     }
    165. }
    166.  
    167. public ze_user_humanized(id)
    168. {
    169.     remove_task(id)
    170.     set_cvars(id)
    171. }
    172.  
    173. /*================================================================================
    174.  [Other Functions]
    175. =================================================================================*/
    176.  
    177. public register_ham_czbots(id)
    178. {
    179.     if (g_bHamCzBots || !is_user_bot(id) || !is_user_connected(id)) return
    180.    
    181.     RegisterHamFromEntity(Ham_Spawn, id, "fwd_PlayerSpawn_Post", 1)
    182.     RegisterHamFromEntity(Ham_Killed, id, "fwd_PlayerKilled_Post", 1)
    183.    
    184.     g_bHamCzBots = true
    185. }
    186.  
    187. set_cvars(id)
    188. {
    189.     g_bZombie[id] = g_bMother[id] = g_bHealing[id] = false
    190.     g_iHealCounter[id] = 0
    191. }
    192.  
    193. public Mother_Heal(id)
    194. {
    195.     if (!g_bHealing[id]) return
    196.    
    197.     static Float:originF[3]
    198.     pev(id, pev_origin, originF)
    199.    
    200.     for (new i = 1; i <= g_iMaxPlayers; i++)
    201.         g_bInRange[id][i] = false
    202.    
    203.     static Float:range, Float:amount, victim
    204.     range = get_pcvar_float(cvar_Range)
    205.     amount = get_pcvar_float(cvar_Amount)
    206.     victim = -1
    207.    
    208.     while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, range)) != 0)
    209.     {
    210.         if (!is_user_valid_alive(victim) || !g_bZombie[victim] || victim == id) continue
    211.        
    212.         g_bInRange[id][victim] = true
    213.        
    214.         new Float:currentHP
    215.         pev(victim, pev_health, currentHP)     
    216.         if (currentHP + amount < g_flMaxHealth[victim])
    217.         {
    218.             set_pev(victim, pev_health, currentHP + amount)
    219.             g_iHealCounter[id]++
    220.         }
    221.         else
    222.             set_pev(victim, pev_health, g_flMaxHealth[victim])
    223.     }
    224.    
    225.     while (g_iHealCounter[id] > get_pcvar_num(cvar_Counter))
    226.     {
    227.         static origin[3]
    228.         get_user_origin(id, origin)
    229.        
    230.         message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
    231.         write_byte(TE_IMPLOSION) // TE id
    232.         write_coord(origin[0]) // x
    233.         write_coord(origin[1]) // y
    234.         write_coord(origin[2]) // z
    235.         write_byte(128) // radius
    236.         write_byte(20) // count
    237.         write_byte(3) // duration
    238.         message_end()
    239.        
    240.         ze_set_escape_coins(id, ze_get_escape_coins(id) + 1)
    241.        
    242.         g_iHealCounter[id] -= get_pcvar_num(cvar_Counter)
    243.     }
    244. }
Image

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#4

Post by Rain1153 » 4 Months Ago

brute mother is buggy dont use it people but spitter is cool :)
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#5

Post by Rain1153 » 4 Months Ago

LOL

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 1 Year Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 21
Contact:

#6

Post by johnnysins2000 » 4 Months Ago

#include <ze_zombie_class> so u have added natives in this include ?

i was looking in zombie escape

kindly share it below with me bro !
Nobody Is That Busy If They Make Time :roll:

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 10 Months Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 20
Contact:

#7

Post by Prekrasnoe Daleko » 4 Months Ago

johnnysins2000, this inc. here look viewtopic.php?f=15&t=3223

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#8

Post by Jack GamePlay » 4 Months Ago

Rain1153 wrote:
4 Months Ago
https://forums.alliedmods.net/showthread.php?t=169354
Another suggestion jack 😎
Try


  1. #include <zombie_escape>
  2. #include <ze_zombie_class>
  3. #include < engine >
  4.  
  5. #define _PLUGIN     "[ZP] Zombie Class: Banshee Zombie"
  6. #define _VERSION                  "1.0"
  7. #define _AUTHOR                "H.RED.ZONE"
  8.  
  9. #define _MarkPlayerConnected(%0)  _bitPlayer[Connected] |= (1 << (%0 & 31))
  10. #define _ClearPlayerConnected(%0) _bitPlayer[Connected] &= ~(1 << (%0 & 31))
  11. #define _IsPlayerConnected(%0)    _bitPlayer[Connected] & (1 << (%0 & 31))
  12.  
  13. #define _MarkPlayerAlive(%0)  _bitPlayer[Alive] |= (1 << (%0 & 31))
  14. #define _ClearPlayerAlive(%0) _bitPlayer[Alive] &= ~(1 << (%0 & 31))
  15. #define _IsPlayerAlive(%0)    _bitPlayer[Alive] & (1 << (%0 & 31))
  16.  
  17. #define _MarkPlayerZombie(%0)  _bitPlayer[Zombie] |= (1 << (%0 & 31))
  18. #define _ClearPlayerZombie(%0) _bitPlayer[Zombie] &= ~(1 << (%0 & 31))
  19. #define _IsPlayerZombie(%0)    _bitPlayer[Zombie] & (1 << (%0 & 31))
  20.  
  21. #define _MarkPlayerBanshee(%0)  _bitPlayer[Banshee] |= (1 << (%0 & 31))
  22. #define _ClearPlayerBanshee(%0) _bitPlayer[Banshee] &= ~(1 << (%0 & 31))
  23. #define _IsPlayerBanshee(%0)    _bitPlayer[Banshee] & (1 << (%0 & 31))
  24.  
  25. #define _MarkPlayerHasBats(%0)  _bitPlayer[HasBats] |= (1 << (%0 & 31))
  26. #define _ClearPlayerHasBats(%0) _bitPlayer[HasBats] &= ~(1 << (%0 & 31))
  27. #define _IsPlayerHasBats(%0)    _bitPlayer[HasBats] & (1 << (%0 & 31))
  28.  
  29. #define _MarkPlayerInTrouble(%0)  _bitPlayer[InTrouble] |= (1 << (%0 & 31))
  30. #define _ClearPlayerInTrouble(%0) _bitPlayer[InTrouble] &= ~(1 << (%0 & 31))
  31. #define _IsPlayerInTrouble(%0)    _bitPlayer[InTrouble] & (1 << (%0 & 31))
  32.  
  33. #define fm_get_entity_flags(%1)    pev(%1, pev_flags)
  34.  
  35. enum _Bits {
  36.     HasBats,
  37.     InTrouble,
  38.     Alive,
  39.     Connected,
  40.     Zombie,
  41.     Banshee
  42. }
  43.  
  44. new _bitPlayer[_Bits]
  45.  
  46. new const zclass_name[] = "Banshee Zombie"
  47. new const zclass_info[] = "Press F"
  48. const zclass_health = 2000
  49. const zclass_speed = 280
  50. const zclass_gravity = 870
  51.  
  52. new const _BAT_ModEL[] = "models/zombie_plague/bat_witch.mdl"
  53. new const _ENT_ClaSS[] = "bat_witch"
  54.  
  55. enum (+= 110) {
  56.     TASK_BAT_FLY,
  57.     TASK_HOOK_HUMAN,
  58.     TASK_THROW_BAT,
  59.     TASK_COOLDOWN
  60. }
  61.  
  62. enum _Cvar {
  63.     _Cooldown,
  64.     _RemoveBet_Time,
  65.     _Hook_speed
  66. }
  67.  
  68. new pCvar [_Cvar]
  69.  
  70. new gClass_BansheeID
  71. new gExplosion_Spr
  72. new gEntity
  73.  
  74. new g_Bat_Mode[33]
  75. new g_Target[33]
  76.  
  77. public plugin_init() {
  78.     register_plugin(_PLUGIN, _VERSION, _AUTHOR)
  79.    
  80.     register_impulse(100, "_THrow_Bats")
  81.     register_touch(_ENT_ClaSS, "*", "_FW_Touch")
  82.     register_event("HLTV", "_Event_NewRound", "1=0", "2=0")
  83.    
  84.     RegisterHam(Ham_Killed, "player", "_FW_Player_Killed", 1)
  85.     RegisterHam(Ham_Spawn, "player", "_FW_Player_Spawn", 1 );
  86.     RegisterHam(Ham_Touch, "player", "_FW_Player_Touch", 0)
  87.    
  88.     pCvar[_Cooldown] = register_cvar("zp_banshee_cooldown","30.0")
  89.     pCvar[_RemoveBet_Time] = register_cvar("zp_banshee_time_removebat","10.0")
  90.     pCvar[_Hook_speed] = register_cvar("zp_banshee_hook_speed","320.0")
  91. }
  92.  
  93. public plugin_precache() {
  94.     gClass_BansheeID = ze_register_zombie_class(zclass_name, zclass_info, zclass_health, zclass_speed, zclass_gravity) 
  95.  
  96.     gExplosion_Spr = precache_model("sprites/zerogxplode.spr")
  97.     precache_model(_BAT_ModEL)
  98. }
  99.  
  100. public client_connect(plr) {
  101.     _MarkPlayerConnected(plr)
  102. }
  103.  
  104. public client_disconnected(plr) {
  105.     _ClearPlayerConnected(plr)
  106. }
  107.  
  108. public _FW_Player_Spawn(plr) {
  109.     if(_IsPlayerConnected(plr)) {
  110.         _MarkPlayerAlive(plr)
  111.     }
  112. }
  113.  
  114. public ze_user_infected(_plr) {
  115.     _MarkPlayerZombie(_plr)
  116.    
  117.     if(ze_get_current_zombie_class(_plr) == gClass_BansheeID) {
  118.             _MarkPlayerHasBats(_plr)
  119.             _MarkPlayerBanshee(_plr)
  120.     }
  121.    
  122.     if(_IsPlayerInTrouble(_plr)) {
  123.         if(task_exists(TASK_BAT_FLY)) {
  124.             remove_task(TASK_BAT_FLY)
  125.         }
  126.         if(task_exists(TASK_HOOK_HUMAN)) {
  127.             remove_task(TASK_HOOK_HUMAN)
  128.         }
  129.        
  130.         if(is_valid_ent(gEntity)) {
  131.             remove_entity(gEntity)
  132.         }
  133.     }
  134. }
  135.  
  136. public ze_user_humanized(plr) {
  137.     _ClearPlayerZombie(plr)
  138.     _ClearPlayerBanshee(plr)
  139. }
  140.  
  141. public _FW_Player_Killed(victim, attacker, shouldgib) {
  142.     if (_IsPlayerConnected(victim)) {
  143.         _ClearPlayerAlive(victim)
  144.         _ClearPlayerBanshee(victim)
  145.        
  146.         if(_IsPlayerBanshee(victim)) {
  147.             if(_IsPlayerZombie(victim)) {
  148.                 entity_set_int(victim, EV_INT_sequence, random_num(128, 137))
  149.             }
  150.         }
  151.         _ClearPlayerZombie(victim)
  152.     }
  153. }
  154.  
  155. public _Event_NewRound(id) {
  156.     _bitPlayer[HasBats] = 0
  157.    
  158.     if(task_exists(TASK_BAT_FLY)) {
  159.         remove_task(TASK_BAT_FLY)
  160.     }
  161.     if(task_exists(TASK_HOOK_HUMAN)) {
  162.         remove_task(TASK_HOOK_HUMAN)
  163.     }
  164.     if(task_exists(id+TASK_THROW_BAT)) {
  165.         remove_task(id+TASK_THROW_BAT)
  166.     }
  167.     if(task_exists(id+TASK_COOLDOWN)) {
  168.         remove_task(id+TASK_COOLDOWN)
  169.     }
  170.        
  171.     remove_entity(gEntity) 
  172.     _bitPlayer[InTrouble] = 0
  173. }
  174.  
  175. public _THrow_Bats(plr) {
  176.     if(fm_get_entity_flags(plr) & FL_ONGROUND)
  177.         return
  178.    
  179.     if(_IsPlayerAlive(plr) && _IsPlayerZombie(plr) && _IsPlayerBanshee(plr)) {
  180.         if(_IsPlayerHasBats(plr)) {
  181.             new _Body
  182.                 ,_Target
  183.             get_user_aiming(plr, _Target, _Body, 99999)
  184.            
  185.             if(_Target && is_valid_ent(_Target)) {
  186.                 g_Bat_Mode[plr] = 1
  187.                 g_Target[plr] = _Target
  188.                 _MarkPlayerInTrouble(_Target)
  189.                
  190.                 _Create_Bets(plr)
  191.                
  192.                 static bat_array[2]
  193.                
  194.                 bat_array[0] = gEntity
  195.                 bat_array[1] = g_Target[plr]
  196.                
  197.                 set_task(0.1, "_Set_BatFly", TASK_BAT_FLY, bat_array, sizeof(bat_array), "b")
  198.                 set_task(get_pcvar_float(pCvar[_RemoveBet_Time]), "_Remove_Bats", _Target+TASK_THROW_BAT)
  199.             } else {
  200.                 g_Bat_Mode[plr] = 2
  201.                
  202.                 _Create_Bets(plr)
  203.                
  204.                 new Float:Velocity1[3]
  205.                 VelocityByAim(plr, 700, Velocity1)
  206.                
  207.                 entity_set_vector(gEntity, EV_VEC_velocity, Velocity1)
  208.             }
  209.             set_task(get_pcvar_float(pCvar[_Cooldown]), "_Remove_Cooldown", plr+TASK_COOLDOWN)
  210.         }
  211.     }
  212. }
  213.  
  214. public _Set_BatFly(bat_array[], taskid) {
  215.     static _Target
  216.     _Target = bat_array[1]
  217.    
  218.     new owner
  219.    
  220.     if(is_valid_ent(gEntity))
  221.         owner = entity_get_edict(gEntity,EV_ENT_owner)
  222.                            
  223.     if(_IsPlayerAlive(owner))
  224.     {
  225.         _Set_Hook(_Target, gEntity)
  226.     } else {
  227.         if(task_exists(TASK_BAT_FLY)) remove_task(TASK_BAT_FLY)
  228.         if(task_exists(TASK_HOOK_HUMAN)) remove_task(TASK_HOOK_HUMAN)
  229.        
  230.         remove_entity(gEntity) 
  231.     }
  232. }
  233.  
  234. public _SetGrab_player(graber, grabed) {
  235.     new array2[2]
  236.     array2[0] = graber
  237.     array2[1] = grabed
  238.    
  239.     set_task(0.1, "_SetGrab_player2", TASK_HOOK_HUMAN, array2, sizeof(array2), "b")
  240. }
  241.  
  242. public _SetGrab_player2(array2[], taskid) {
  243.     static id
  244.     static target
  245.    
  246.     id = array2[0]
  247.     target = array2[1]
  248.    
  249.     _Set_Hook(id, target)
  250.     entity_set_int(gEntity, EV_INT_solid, SOLID_NOT)
  251. }
  252.  
  253. public _Set_Hook(hooker, hooked) {
  254.     static Float:originF[3]
  255.    
  256.     new Float:fl_Velocity[3];
  257.     new Float:vicOrigin[3]
  258.     new Float:distance = get_distance_f(originF, vicOrigin);
  259.    
  260.     entity_get_vector(hooker , EV_VEC_origin , originF );
  261.     entity_get_vector(hooked , EV_VEC_origin , vicOrigin );
  262.  
  263.     if (distance > 1.0) {
  264.         new Float:fl_Time = distance / get_pcvar_float(pCvar[_Hook_speed])
  265.  
  266.         fl_Velocity[0] = (originF[0] - vicOrigin[0]) / fl_Time
  267.         fl_Velocity[1] = (originF[1] - vicOrigin[1]) / fl_Time
  268.         fl_Velocity[2] = (originF[2] - vicOrigin[2]) / fl_Time
  269.     } else {
  270.         fl_Velocity[0] = 0.0
  271.         fl_Velocity[1] = 0.0
  272.         fl_Velocity[2] = 0.0
  273.     }
  274.  
  275.     entity_set_vector(hooked, EV_VEC_velocity, fl_Velocity);
  276. }
  277.  
  278. public _Create_Bets(owner) {
  279.     gEntity = create_entity("info_target")
  280.    
  281.     new Float:Origin[3], Float:Angle[3]
  282.    
  283.     entity_get_vector(owner, EV_VEC_v_angle, Angle)
  284.     entity_get_vector(owner, EV_VEC_origin, Origin)
  285.     entity_set_origin(gEntity, Origin)
  286.    
  287.     entity_set_string(gEntity,EV_SZ_classname, _ENT_ClaSS);
  288.     entity_set_model(gEntity, _BAT_ModEL)
  289.     entity_set_int(gEntity,EV_INT_solid, 2)
  290.     entity_set_int(gEntity, EV_INT_movetype, 5)
  291.    
  292.     entity_set_vector(gEntity, EV_VEC_angles, Angle)
  293.    
  294.     entity_set_byte(gEntity,EV_BYTE_controller1,125);
  295.     entity_set_byte(gEntity,EV_BYTE_controller2,125);
  296.     entity_set_byte(gEntity,EV_BYTE_controller3,125);
  297.     entity_set_byte(gEntity,EV_BYTE_controller4,125);
  298.    
  299.     new Float:maxs[3] = {10.0,10.0,15.0}
  300.     new Float:mins[3] = {-10.0,-10.0,-15.0}
  301.     entity_set_size(gEntity,mins,maxs)
  302.    
  303.     entity_set_edict(gEntity, EV_ENT_owner, owner)
  304.    
  305.     entity_set_float(gEntity,EV_FL_animtime,2.0)
  306.     entity_set_float(gEntity,EV_FL_framerate,1.0)
  307.     entity_set_int(gEntity,EV_INT_sequence, 0) 
  308. }
  309.  
  310. public _FW_Touch(ent, touched) {
  311.     new owner = entity_get_edict(gEntity,EV_ENT_owner)
  312.     new id = g_Target[owner]
  313.        
  314.     if(g_Bat_Mode[owner] == 1 && ~_IsPlayerInTrouble(id) && ~_IsPlayerZombie(id)) {
  315.        
  316.         _MarkPlayerInTrouble(id)
  317.         _SetGrab_player(owner, id)
  318.     } else if(g_Bat_Mode[owner] == 2 && ~_IsPlayerInTrouble(touched)) {
  319.         if(_IsPlayerAlive(touched) && ~_IsPlayerZombie(touched)) {
  320.             _SetGrab_player(owner, touched)
  321.             _MarkPlayerInTrouble(touched)
  322.            
  323.             static bat_array[2]
  324.             bat_array[0] = ent
  325.             bat_array[1] = touched
  326.        
  327.             set_task(0.1, "_Set_BatFly", TASK_BAT_FLY, bat_array, sizeof(bat_array), "b")
  328.         } else {
  329.             new Float:Origin[3]
  330.             entity_get_vector(ent, EV_VEC_origin, Origin)
  331.  
  332.             message_begin(MSG_BROADCAST ,SVC_TEMPENTITY)
  333.             write_byte(3)
  334.             engfunc(EngFunc_WriteCoord, Origin[0])
  335.             engfunc(EngFunc_WriteCoord, Origin[1])
  336.             engfunc(EngFunc_WriteCoord, Origin[2])
  337.             write_short(gExplosion_Spr)
  338.             write_byte(25)
  339.             write_byte(30)
  340.             write_byte(0)
  341.             message_end()
  342.            
  343.             remove_entity(ent) 
  344.         }
  345.     }
  346. }
  347.  
  348. public _FW_Player_Touch(ptr, ptd) {
  349.     if(!is_valid_ent(ptr) || !is_valid_ent(ptd))
  350.         return FMRES_IGNORED
  351.        
  352.     if(~_IsPlayerAlive(ptr) || ~_IsPlayerAlive(ptd) || ~_IsPlayerZombie(ptr) || _IsPlayerZombie(ptd))
  353.         return FMRES_IGNORED
  354.        
  355.     if(_IsPlayerInTrouble(ptd) && g_Bat_Mode[ptr] == 1) {
  356.         remove_task(TASK_BAT_FLY)
  357.         remove_task(TASK_HOOK_HUMAN)
  358.         remove_task(TASK_THROW_BAT)
  359.        
  360.         remove_entity(gEntity)
  361.         _ClearPlayerInTrouble(ptd)
  362.     } else if(_IsPlayerInTrouble(ptd) && g_Bat_Mode[ptr] == 1) {
  363.         remove_task(TASK_BAT_FLY)
  364.         remove_task(TASK_HOOK_HUMAN)
  365.         remove_task(TASK_THROW_BAT)
  366.        
  367.         remove_entity(gEntity)
  368.         _ClearPlayerInTrouble(ptd)
  369.     }
  370.     return FMRES_HANDLED
  371. }
  372.  
  373. public remove_bat(taskid) {
  374.     new id = taskid - TASK_THROW_BAT
  375.    
  376.     if(task_exists(TASK_BAT_FLY)) remove_task(TASK_BAT_FLY)
  377.     if(task_exists(TASK_HOOK_HUMAN)) remove_task(TASK_HOOK_HUMAN)
  378.     if(task_exists(id+TASK_THROW_BAT)) remove_task(id+TASK_THROW_BAT)
  379.        
  380.     if(is_valid_ent(gEntity)) {
  381.         remove_entity(gEntity)
  382.     }
  383.        
  384.     _ClearPlayerInTrouble(id)
  385. }
  386.  
  387. public remove_cooldown(taskid) {
  388.     new id = taskid - TASK_COOLDOWN
  389.    
  390.     if(_IsPlayerAlive(id) && _IsPlayerZombie(id) && _IsPlayerBanshee(id)) {
  391.         client_print(id, print_chat,"Now you can Drop Bat. Press (F)")
  392.         _MarkPlayerHasBats(id)
  393.     }
  394. }
  395. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  396. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10266\\ f0\\ fs16 \n\\ par }
  397. */
Image

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 10 Months Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 20
Contact:

#9

Post by Prekrasnoe Daleko » 4 Months Ago

Jack GamePlay, Maybe only be done for Vip?

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#10

Post by Jack GamePlay » 4 Months Ago

Prekrasnoe Daleko wrote:
4 Months Ago
Jack GamePlay, Maybe only be done for Vip?
I don't understand.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest