Approved Bunche of zombie classes

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

Re: Bunche of zombie classes

#11

Post by Prekrasnoe Daleko » 1 Year Ago

Jack GamePlay wrote:
1 Year Ago
Prekrasnoe Daleko wrote:
1 Year Ago
Jack GamePlay, Maybe only be done for Vip?
I don't understand.
make this class to VIP , not using default players

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 624
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#12

Post by Mohamed Alaa » 1 Year Ago

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

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

#13

Post by Prekrasnoe Daleko » 1 Year Ago

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

User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 150
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

#14

Post by Luxurious » 1 Year Ago

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

  1.  error 010: invalid function or declaration
  2. // D:\Games\Funny\Rehlds_publish_3.4.0.641_artifacts\old\Addons\Compiler v1.8.3\scripting\include\engine_const.inc(88) : error 010: invalid function or declaration
  3. // D:\Games\Funny\Rehlds_publish_3.4.0.641_artifacts\old\Addons\Compiler v1.8.3\scripting\zc_class_banshee.sma(172) : error 017: undefined symbol "EV_INT_sequence"
  4. // D:\Games\Funny\Rehlds_publish_3.4.0.641_artifacts\old\Addons\Compiler v1.8.3\scripting\zc_class_banshee.sma(172) : error 001: expected token: ";", but found ")"
  5. // D:\Games\Funny\Rehlds_publish_3.4.0.641_artifacts\old\Addons\Compiler v1.8.3\scripting\zc_class_banshee.sma(172) : error 029: invalid expression, assumed zero
  6. // D:\Games\Funny\Rehlds_publish_3.4.0.641_artifacts\old\Addons\Compiler v1.8.3\scripting\zc_class_banshee.sma(172) : fatal error 107: too many error messages on one line
  7. //
  8. // Compilation aborted.
  9. // 6 Errors.
  10. // Could not locate output file D:\Games\Funny\Rehlds_publish_3.4.0.641_artifacts\old\Addons\Compiler v1.8.3\scripting\compiled\zc_class_banshee.amx (compile failed).
BeTalk Zombie-Escape V1.4
IP : 51.77.103.159:27015

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 624
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#15

Post by Mohamed Alaa » 1 Year Ago

Use fixed compiler.
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

User avatar
Luxurious
Senior Member
Senior Member
Egypt
Posts: 150
Joined: 1 Year Ago
Location: Egypt
Has thanked: 3 times
Been thanked: 4 times
Contact:

#16

Post by Luxurious » 1 Year Ago

Jack GamePlay wrote:
1 Year Ago
Use fixed compiler.
i using the latest one !
BeTalk Zombie-Escape V1.4
IP : 51.77.103.159:27015

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#17

Post by Spir0x » 1 Year Ago

this class is bugged i installed it but when i click 5. Banshee Zombie nothing appear from chat and the class never work.
I trynna make money, not friends.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 624
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#18

Post by Mohamed Alaa » 1 Year Ago

Spir0x wrote:
1 Year Ago
this class is bugged i installed it but when i click 5. Banshee Zombie nothing appear from chat and the class never work.
There is no banshee zombie class here.
This is not one class but 5 classes.
Read the topic again.
If you have errors, post all errors you face.
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 633
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#19

Post by Spir0x » 1 Year Ago

Jack GamePlay wrote:
1 Year Ago
Rain1153 wrote:
1 Year 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. */
so what's this ?
I trynna make money, not friends.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 624
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#20

Post by Mohamed Alaa » 1 Year Ago

Any errors?
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests