Approved Bunche of zombie classes

Plug-ins compatibility with Zombie Escape 1.x only!


Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 6 years ago
Location: Россия,Крым
Contact:

#11

Post by Prekrasnoe Daleko » 5 years ago

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

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#12

Post by Night Fury » 5 years ago

Prekrasnoe Daleko wrote: 5 years 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. */
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 6 years ago
Location: Россия,Крым
Contact:

#13

Post by Prekrasnoe Daleko » 5 years ago

Jack GamePlay wrote: 5 years ago
Prekrasnoe Daleko wrote: 5 years 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
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#14

Post by Luxurious » 5 years ago

Jack GamePlay wrote: 5 years ago
Prekrasnoe Daleko wrote: 5 years 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).
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#15

Post by Night Fury » 5 years ago

Use fixed compiler.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#16

Post by Luxurious » 5 years ago

Jack GamePlay wrote: 5 years ago Use fixed compiler.
i using the latest one !
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#17

Post by Spir0x » 5 years ago

this class is bugged i installed it but when i click 5. Banshee Zombie nothing appear from chat and the class never work.

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#18

Post by Night Fury » 5 years ago

Spir0x wrote: 5 years 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 private projects.
Discord: Fury#7469
Image

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#19

Post by Spir0x » 5 years ago

Jack GamePlay wrote: 5 years ago
Rain1153 wrote: 5 years 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 ?

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#20

Post by Night Fury » 5 years ago

Any errors?
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#21

Post by Spir0x » 5 years ago

There's no erros on compiler it compiles fine but the banshee zombie class won't work when i click on 6. Banshee Zombie VIP no thing happen.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#22

Post by Spir0x » 5 years ago

up

User avatar
crasy00skull
Member
Member
Algeria
Posts: 1
Joined: 5 years ago
Contact:

#23

Post by crasy00skull » 5 years ago

i need ze_zombie_classes.inc :) help
Crasy Skull

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#24

Post by Spir0x » 5 years ago

zombie_classes.inc:

Code:

Code: Select all

#include <ze_zombie_classes_const>
 
/*****************************************/
/************   FORWARDS    **************/
/*****************************************/
 
/**
 * Called when determining whether a class should be available to a player.
 *
 * Possible return values are:
 *  - ZE_CLASS_AVAILABLE (show in menu, allow selection)
 *  - ZE_CLASS_UNAVAILABLE (show in menu, don't allow selection)
 *  - ZE_CLASS_DONT_SHOW (don't show in menu, don't allow selection)
 *
 * @param id            Player index.
 * @param classid       Internal zombie class ID.
 */
forward ze_select_zombie_class_pre(id, classid)
 
/**
 * Called right after a player selects a class from the menu.
 *
 * @param id            Player index.
 * @param classid       Internal zombie class ID.
 */
forward ze_select_zombie_class_post(id, classid)
 
/*****************************************/
/************** NATIVES ******************/
/*****************************************/
 
/**
 * Returns a player's current zombie class ID.
 *
 * @param id        Player index.
 * @return          Internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS if not yet chosen.
 */
native ze_get_current_zombie_class(id)
 
/**
 * Returns a player's next zombie class ID (for the next infection).
 *
 * @param id        Player index.
 * @return          Internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS if not yet chosen.
 */
native ze_get_next_zombie_class(id)
 
/**
 * Sets a player's next zombie class ID (for the next infection).
 *
 * @param id        Player index.
 * @param classid   A valid zombie class ID.
 * @return          True on success, false otherwise.
 */
native ze_set_next_zombie_class(id, classid)
 
/**
 * Returns the default maximum health for a specific zombie class.
 *
 * Note: does not take into account any kind of HP multipliers.
 *
 * @param id        Player index.
 * @param classid   A valid zombie class ID.
 * @return          Maximum amount of health points, -1 on error.
 */
native ze_get_zombie_class_health(id, classid)
 
/**
 * Registers a custom class which will be added to the zombie classes menu of ZP.
 *
 * Note: The returned zombie class ID can be later used to identify
 * the class when calling the zp_get_user_zombie_class() natives.
 *
 * @param name          Caption to display on the menu.
 * @param description   Brief description of the class.
 * @param health        Class health.
 * @param speed         Class maxspeed (can be a multiplier).
 * @param gravity       Class gravity multiplier.
 * @return              An internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS on failure.
 */
native ze_register_zombie_class(const name[], const description[], health, speed, gravity)
 
/**
 * Returns a zombie class' ID.
 *
 * @param name      Class name to look for.
 * @return          Internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS if not found.
 */
native ze_get_zombie_class_id(const real_name[])
 
/**
 * Returns a zombie class' name.
 *
 * @param classid   A valid zombie class ID.
 * @param name      The buffer to store the string in.
 * @param len       Character size of the output buffer.
 * @return          True on success, false otherwise.
 */
native ze_get_zombie_class_name(classid, name[], len)
 
/**
 * Returns a zombie class' description.
 *
 * @param classid       A valid zombie class ID.
 * @param description   The buffer to store the string in.
 * @param len           Character size of the output buffer.
 * @return              True on success, false otherwise.
 */
native ze_get_zombie_class_desc(classid, description[], len)
 
/**
 * Returns number of registered zombie classes.
 *
 * @return          Zombie class count.
 */
native ze_get_zombie_class_number()
 
/**
 * Shows menu with available zombie classes to a player.
 *
 * @param id        Player index.
 */
native ze_open_zombie_classes_menu(id)
 
/**
 * Appends text to a class being displayed on the zombie classes menu.
 * Use this on the class select pre forward.
 *
 * @param text      Additional text to display.
 */
native ze_add_zombie_class_menu_text(const text[])

DeVil_Raghav
Member
Member
India
Posts: 25
Joined: 3 years ago
Contact:

#25

Post by DeVil_Raghav » 3 years ago

Hey escapers, I have a problem with compiling the "banshee" code, it shows "could not locate ouput file c:\hp\users\desktop\scripting\compiled\ze_banshee.amxx" compiled failed.

What should I do ? Help me :) :D
Thank You :)

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 477
Joined: 5 years ago
Location: The Red City ❤
Contact:

#26

Post by z0h1r-LK » 3 years ago

Mohamed Alaa wrote: 5 years ago
Prekrasnoe Daleko wrote: 5 years ago Jack GamePlay, Maybe only be done for Vip?
I don't understand.
him is mean,you can updated zombie class if you want make Zombie for VIP (access) ...
Zombie Leech - [VIP Only]

DeVil_Raghav
Member
Member
India
Posts: 25
Joined: 3 years ago
Contact:

#27

Post by DeVil_Raghav » 3 years ago

I am getting error in this code of banshee zombie class for zombie escape server may be I am doing it wrong please help

THANK YOU :)
Attachments
ze_banshee.sma
(12.09 KiB) Downloaded 342 times
ze_banshee.sma
(12.09 KiB) Downloaded 342 times

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#28

Post by Night Fury » 3 years ago

DeVil_Raghav wrote: 3 years ago I am getting error in this code of banshee zombie class for zombie escape server may be I am doing it wrong please help

THANK YOU :)
What's the error exactly?
Paste it here so we can help.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

DeVil_Raghav
Member
Member
India
Posts: 25
Joined: 3 years ago
Contact:

#29

Post by DeVil_Raghav » 3 years ago

Mohamed Alaa wrote: 3 years ago
DeVil_Raghav wrote: 3 years ago I am getting error in this code of banshee zombie class for zombie escape server may be I am doing it wrong please help

THANK YOU :)
What's the error exactly?
Paste it here so we can help.
The Error is =
//C:\Users\error\hp\Downloads\compiler\scripting\ze_banshee.sma<2> : fatal error 100: cannot read from file: "ze_zombie_class"
//
//compilaton aborted
//1 Error.
//could no locate the ouput file C:\Users\hp\Downloads\compiler\scripting\compiled\ze_banshee.amx <compile failed>.
//
//compilation time : 2.92 sec

DeVil_Raghav
Member
Member
India
Posts: 25
Joined: 3 years ago
Contact:

#30

Post by DeVil_Raghav » 3 years ago

Up

Post Reply

Create an account or sign in to join the discussion

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

Create an account

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

Register

Sign in

Who is online

Users browsing this forum: No registered users and 0 guests