Covert zombie class

Unpaid Requests, Public Plugins
Post Reply
BandiT
Member
Member
Romania
Posts: 59
Joined: 4 years ago
Contact:

Covert zombie class

#1

Post by BandiT » 3 years ago

Who can help me to covert this zombie class to our mod ?

  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4. #include <hamsandwich>
  5. #include <zombieplague>
  6. #include <cstrike>
  7. #include <xs>
  8.  
  9. new const ball_name[] = "paralize_ball"
  10. new const ball_model[] = "models/w_hiddentail2.mdl"
  11. new const ball_soundtouch[] = { "warcraft3/frostnova.wav" }
  12.  
  13. new const zclass_name[] = { "Renevant Ice" } // name
  14. new const zclass_info[] = { "Trow ice grenade and freze human" } // description
  15. new const zclass_model[] = { "revenant_ice" } // model
  16. new const zclass_clawmodel[] = { "v_revenant_ice.mdl" } // claw model
  17. const zclass_health = 2000 // health
  18. const zclass_speed = 245 // speed
  19. const Float:zclass_gravity = 0.7 // gravity
  20. const Float:zclass_knockback = 1.0 // knockback
  21. new const v_zombie_bomb_model[64] = "revenant_ice"
  22.  
  23. new g_CurWeapon[33], g_bombmodelwpn[64]
  24.  
  25. #define OFFSET_MODELINDEX 491
  26. #define OFFSET_LINUX 5
  27.  
  28. new index, defaultindex
  29.  
  30. new g_zclassparalize
  31. new cvar_paralizedelay , cvar_paralizevelocity  , cvar_paralizeballhealth , cvar_paralizeballparalizetime
  32. new sTrail , g_touchs[512] , g_can[33] , g_paralizen[33]
  33.  
  34. new const WeaponNames[][] =
  35. {
  36.         "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
  37.         "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
  38.         "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
  39.         "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
  40.         "weapon_ak47", "weapon_knife", "weapon_p90"
  41. }
  42.  
  43. public plugin_init()
  44. {
  45.     register_plugin("[ZP] Zombie Class: Revenant Ice", "1.0", "=), LARS-BLOODLIKER")
  46.  
  47.     cvar_paralizedelay = register_cvar("zp_classparalize_delay","15")
  48.     cvar_paralizevelocity = register_cvar("zp_classparalizeball_velocity","1300")
  49.     cvar_paralizeballhealth = register_cvar("zp_classparalizeball_health","5")
  50.     cvar_paralizeballparalizetime = register_cvar ( "zp_classparalizeball_paralizetime", "7.0" )
  51.  
  52.     register_touch(ball_name, "worldspawn",     "touchWorld")
  53.     register_touch(ball_name, "func_wall",          "touchWorld")
  54.     register_touch(ball_name, "func_door",          "touchWorld")
  55.     register_touch(ball_name, "func_door_rotating", "touchWorld")
  56.     register_touch(ball_name, "func_wall_toggle",   "touchWorld")
  57.     register_touch(ball_name, "func_breakable", "touchWorld")
  58.     register_touch(ball_name, "player",         "touchPlayer")
  59.     register_think(ball_name,"ball_think")
  60.  
  61.     register_clcmd("drop","paralize_cmd")
  62.     register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  63.     register_forward(FM_PlayerPreThink, "fw_PreThink")
  64.  
  65.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  66.  
  67.     register_event("CurWeapon", "Event_CurrentWeapon", "be", "1=1")
  68.    
  69.     for(new i = 1; i < sizeof WeaponNames; i++)
  70.     if(WeaponNames[i][0]) RegisterHam(Ham_Item_Deploy, WeaponNames[i], "fw_Weapon_Deploy_Post", 1)
  71.  
  72.     RegisterHam(Ham_Player_Duck, "player", "Player_Duck", 1)
  73. }
  74.  
  75. public plugin_precache()
  76. {
  77.     precache_model(ball_model)
  78.     sTrail = precache_model("sprites/laserbeam.spr")
  79.  
  80.     g_zclassparalize = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)   
  81.  
  82.     formatex(g_bombmodelwpn, charsmax(g_bombmodelwpn), "models/zombie_plague/v_bomb_%s.mdl", v_zombie_bomb_model)
  83.     engfunc(EngFunc_PrecacheModel, g_bombmodelwpn)
  84.  
  85.     index = precache_model("models/player/revenant_ice/revenant_ice.mdl")
  86.         defaultindex = precache_model("models/player.mdl")
  87. }
  88.  
  89. public paralize_cmd( id )
  90. {
  91.     if( !is_user_alive(id) || !zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclassparalize || zp_get_user_nemesis(id) )
  92.         return PLUGIN_CONTINUE;
  93.  
  94.     if(g_can[id])
  95.     {
  96.         client_print(id,print_center,"Востановление через %d секунд",g_can[id])
  97.         return PLUGIN_HANDLED;
  98.     }
  99.  
  100.     static Float:origin[3], Float:angles[3], Float:v_forward[3], Float:v_right[3], Float:v_up[3], Float:gun_position[3], Float:player_origin[3], Float:player_view_offset[3];
  101.     static Float:OriginX[3]
  102.     pev(id, pev_v_angle, angles);
  103.     pev(id, pev_origin, OriginX);
  104.     engfunc(EngFunc_MakeVectors, angles);
  105.  
  106.     global_get(glb_v_forward, v_forward);
  107.     global_get(glb_v_right, v_right);
  108.     global_get(glb_v_up, v_up);
  109.  
  110.     //m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
  111.     pev(id, pev_origin, player_origin);
  112.     pev(id, pev_view_ofs, player_view_offset);
  113.     xs_vec_add(player_origin, player_view_offset, gun_position);
  114.  
  115.     xs_vec_mul_scalar(v_forward, 13.0, v_forward);
  116.     xs_vec_mul_scalar(v_right, 0.0, v_right);
  117.     xs_vec_mul_scalar(v_up, 5.0, v_up);
  118.  
  119.     xs_vec_add(gun_position, v_forward, origin);
  120.     xs_vec_add(origin, v_right, origin);
  121.     xs_vec_add(origin, v_up, origin);
  122.  
  123.     new Float:StartOrigin[3]
  124.            
  125.     StartOrigin[0] = origin[0];
  126.     StartOrigin[1] = origin[1];
  127.     StartOrigin[2] = origin[2];
  128.  
  129.  
  130.     new Float:fVelocity[3] , Float:flOrigin[3] , Float:flAngle[3]
  131.     pev(id,pev_origin,flOrigin)
  132.     pev(id,pev_angles,flAngle)
  133.  
  134.     new ball = create_entity("info_target")
  135.    
  136.     if (!ball) return PLUGIN_HANDLED
  137.  
  138.     g_touchs[ball] = 0
  139.  
  140.     entity_set_string(ball, EV_SZ_classname, ball_name)
  141.    
  142.     entity_set_model(ball, ball_model)
  143.    
  144.     entity_set_origin(ball, StartOrigin)
  145.    
  146.     entity_set_vector(ball, EV_VEC_angles, flAngle)
  147.    
  148.     new Float:MinBox[3] = {-1.0, -1.0, -1.0}
  149.     new Float:MaxBox[3] = {1.0, 1.0, 1.0}
  150.     entity_set_vector(ball, EV_VEC_mins, MinBox)
  151.     entity_set_vector(ball, EV_VEC_maxs, MaxBox)
  152.    
  153.     entity_set_int(ball, EV_INT_solid, SOLID_SLIDEBOX)
  154.    
  155.     entity_set_int(ball, EV_INT_movetype, MOVETYPE_BOUNCEMISSILE)
  156.    
  157.     entity_set_edict(ball, EV_ENT_owner, id)
  158.    
  159.     entity_set_int(ball, EV_INT_effects, EF_BRIGHTLIGHT)
  160.    
  161.     VelocityByAim(id, get_pcvar_num(cvar_paralizevelocity ), fVelocity)
  162.     entity_set_vector(ball , EV_VEC_velocity, fVelocity)
  163.  
  164.     fm_set_rendering(ball, kRenderFxGlowShell,255, 255, 255, kRenderNormal, 16)
  165.    
  166.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  167.     write_byte(TE_BEAMFOLLOW) // Temporary entity ID
  168.     write_short(ball) // Entity
  169.     write_short(sTrail) // Sprite index
  170.     write_byte(10) // Life
  171.     write_byte(3) // Line width
  172.     write_byte(100) // Red
  173.     write_byte(255) // Green
  174.     write_byte(255) // Blue
  175.     write_byte(255) // Alpha
  176.     message_end()
  177.  
  178.     UTIL_PlayPlayerAnimation(id,10)
  179.     UTIL_PlayWeaponAnimation(id,8)
  180.  
  181.     g_can[id] = get_pcvar_num(cvar_paralizedelay)
  182.     set_task(1.0,"ability_zero",id)
  183.  
  184.     entity_set_float(ball, EV_FL_health , get_pcvar_float(cvar_paralizeballhealth))
  185.  
  186.     entity_set_float(ball, EV_FL_nextthink, get_gametime() + 0.1)
  187.    
  188.     return PLUGIN_HANDLED;
  189. }
  190.  
  191. public touchWorld(ball, world) {
  192.  
  193.     emit_sound(ball, CHAN_WEAPON, ball_soundtouch, 1.0, ATTN_NORM, 0, PITCH_NORM)
  194.     g_touchs[ball] += 1
  195.     if(g_touchs[ball] == get_pcvar_num(cvar_paralizeballhealth)) remove_entity(ball)
  196.    
  197.     return PLUGIN_HANDLED
  198. }
  199.  
  200. public touchPlayer(ball, player) {
  201.     client_print(0,print_chat,"Вы попали в %d",player)
  202.     remove_task(player)
  203.     paralize(player)
  204.     //set_task(get_pcvar_float(cvar_paralizeballparalizetime),"unparalize_player",player)
  205.    
  206.     return PLUGIN_HANDLED
  207. }
  208.  
  209. public event_round_start()
  210. {
  211.     new iEnt = FM_NULLENT;
  212.     while( (iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", ball_name)) > 0 )
  213.     {
  214.         engfunc(EngFunc_RemoveEntity,iEnt)
  215.     }  
  216.  
  217.     for(new i;i<=32;i++)
  218.     {
  219.         if(g_paralizen[i]) fm_set_rendering(i)
  220.         g_can[i] = 0
  221.         g_paralizen[i] = 0
  222.         remove_task(i)
  223.     }
  224. }
  225.  
  226. public ball_think(ball)
  227. {
  228.     if(!is_valid_ent(ball))
  229.         return;
  230.  
  231.     new Float:oldangles[3],Float:angles[3]
  232.     pev(ball,pev_angles,oldangles)
  233.     angles[0] = oldangles[0] + random_float(20.0,100.0)
  234.     angles[1] = oldangles[1] + random_float(10.0,80.0)
  235.     angles[2] = oldangles[2] + random_float(10.0,80.0)
  236.     set_pev(ball,pev_angles,angles)
  237.  
  238.     new Float:Velocity[3]
  239.     pev(ball,pev_velocity,Velocity)
  240.  
  241.     if(Velocity[0] < 1.0 && Velocity[2] < 1.0 && Velocity[1] < 1.0) remove_entity(ball)
  242.  
  243.     entity_set_float(ball, EV_FL_nextthink, get_gametime() + 0.1)
  244.  
  245. }
  246.  
  247. public paralize(id)
  248. {
  249.     if(!is_user_alive(id) || zp_get_user_zombie(id))
  250.         return;
  251.  
  252.     g_paralizen[id] = 1
  253.     fm_set_rendering(id, kRenderFxGlowShell,100, 255, 255, kRenderNormal, 16)
  254.     set_task(get_pcvar_float(cvar_paralizeballparalizetime),"unparalize_player",id)
  255. }
  256.  
  257. public unparalize_player(id)
  258. {
  259.     if(!is_user_alive(id) || zp_get_user_zombie(id))
  260.         return;
  261.  
  262.     g_paralizen[id] = 0
  263.     fm_set_rendering(id)
  264. }
  265.  
  266. public remove_values(id)
  267. {
  268.     remove_task(id)
  269.     g_can[id] = 0
  270. }
  271.  
  272. public ability_zero(id)
  273. {
  274.     g_can[id] -= 1
  275.     if(!g_can[id]) client_print(id,print_center,"Способность активна!")
  276.     if(g_can[id]) set_task(1.0,"ability_zero",id)
  277. }
  278.  
  279. public fw_PreThink(id)
  280. {
  281.     if( !is_user_alive(id) || zp_get_user_zombie(id) || !g_paralizen[id])
  282.         return PLUGIN_CONTINUE;
  283.  
  284.     set_pev( id, pev_button, pev(id,pev_button) & ~IN_ATTACK );
  285.  
  286.     set_pev(id, pev_maxspeed, 0.0)     
  287.  
  288.     new Float:vel[3]
  289.     set_pev(id,pev_velocity,vel)
  290.  
  291.     return PLUGIN_HANDLED
  292. }
  293.  
  294. public zp_user_humanized_post(id)
  295. {
  296.     fm_set_user_model_index(id, defaultindex)
  297.  
  298.     remove_values(id)
  299. }
  300. public fw_PlayerKilled(id, attacker, shouldgib) remove_values(id)
  301. public client_connect(id)  remove_values(id)
  302.  
  303. public zp_user_infected_post(id)
  304. {
  305.     set_wpnmodel(id)
  306.     if((zp_get_user_zombie_class(id) == g_zclassparalize) && (zp_get_user_zombie(id)))
  307.     {
  308.         fm_set_user_model_index(id, index)
  309.     }
  310.     remove_values(id)
  311. }
  312.  
  313. public zp_user_infected_pre(id)
  314. {
  315.         if(!(get_user_flags(id) & ADMIN_LEVEL_H))
  316.     {
  317.             if(zp_get_user_next_class(id) == g_zclassparalize)
  318.         {
  319.                     zp_set_user_zombie_class(id, 0)
  320.                 client_print(id, print_chat, "Данный класс только для Випов")
  321.                 client_print(id, print_chat, "Стоимость админки на месяц 100 рублей")
  322.             }    
  323.         }    
  324. }
  325.  
  326. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  327. {
  328.     static Float:color[3]
  329.     color[0] = float(r)
  330.     color[1] = float(g)
  331.     color[2] = float(b)
  332.    
  333.     set_pev(entity, pev_renderfx, fx)
  334.     set_pev(entity, pev_rendercolor, color)
  335.     set_pev(entity, pev_rendermode, render)
  336.     set_pev(entity, pev_renderamt, float(amount))
  337. }
  338.  
  339. stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
  340. {
  341.     set_pev(Player, pev_weaponanim, Sequence)
  342.    
  343.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
  344.     write_byte(Sequence)
  345.     write_byte(pev(Player, pev_body))
  346.     message_end()
  347. }
  348.  
  349. stock UTIL_PlayPlayerAnimation(const id, const Sequence , Float:frame = 1.0 , Float:framerate = 1.0)
  350. {
  351.     entity_set_int(id, EV_INT_sequence, Sequence)
  352.     entity_set_int(id, EV_INT_gaitsequence, 1)
  353.     entity_set_float(id, EV_FL_frame, frame)
  354.     entity_set_float(id, EV_FL_framerate, framerate)
  355. }
  356.  
  357. stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
  358. {
  359.     new_velocity[0] = origin2[0] - origin1[0]
  360.     new_velocity[1] = origin2[1] - origin1[1]
  361.     new_velocity[2] = origin2[2] - origin1[2]
  362.     new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
  363.     new_velocity[0] *= num
  364.     new_velocity[1] *= num
  365.     new_velocity[2] *= num
  366.        
  367.     return 1
  368. }
  369.  
  370. stock fm_cs_set_user_deaths(id, value)
  371. {
  372.     set_pdata_int(id, 444, value, 5)
  373. }
  374.  
  375. stock fm_cs_get_user_team(id)
  376. {
  377.     return get_pdata_int(id, 114, 5);
  378. }
  379.  
  380. public Event_CurrentWeapon(id) g_CurWeapon[id] = read_data(2)
  381.  
  382. public fw_Weapon_Deploy_Post(weapon_ent)
  383. {
  384.     static id; id = get_pdata_cbase(weapon_ent, 41, 4)
  385.  
  386.     static weaponid; weaponid = cs_get_weapon_id(weapon_ent)
  387.  
  388.     g_CurWeapon[id] = weaponid
  389.    
  390.     replace_weapon_models(id, weaponid)
  391. }
  392.  
  393. public Player_Duck(id)
  394. {
  395.     if(zp_get_user_zombie_class(id) == g_zclassparalize && zp_get_user_zombie(id))
  396.     {
  397.         static button, ducking
  398.         button = pev(id, pev_button)
  399.         ducking = pev(id, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
  400.  
  401.         if(button & IN_DUCK || ducking)
  402.         {
  403.             set_pev(id, pev_view_ofs, {0.0, 0.0, 20.0})  
  404.         }
  405.     }
  406. }
  407.  
  408. set_wpnmodel(id)
  409. {
  410.     if(!is_user_alive(id)) return
  411.  
  412.     new wpn = get_user_weapon(id)
  413.  
  414.     if(wpn == CSW_HEGRENADE || wpn == CSW_FLASHBANG || wpn == CSW_SMOKEGRENADE)
  415.     {
  416.             set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  417.     }
  418. }
  419.  
  420. replace_weapon_models(id, weaponid)
  421. {
  422.     if(zp_get_user_zombie_class(id) == g_zclassparalize && zp_get_user_zombie(id))
  423.     {
  424.         switch(weaponid)
  425.         {
  426.             case CSW_HEGRENADE:
  427.             {
  428.                 set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  429.             }
  430.             case CSW_SMOKEGRENADE:
  431.             {
  432.                 set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  433.             }
  434.             case CSW_FLASHBANG:
  435.             {
  436.                 set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  437.             }
  438.         }
  439.     }
  440. }
  441.  
  442. stock fm_set_user_model_index(id, value)
  443. {
  444.     set_pdata_int(id, OFFSET_MODELINDEX, value, OFFSET_LINUX)
  445. }
Last edited by Raheem 3 years ago, edited 2 times in total.
Reason: Added codebox tag.

karan
Mod Tester
Mod Tester
India
Posts: 122
Joined: 6 years ago
Location: India
Contact:

#2

Post by karan » 3 years ago

try
  1. #include <zombie_escape>
  2. #include <amxmodx>
  3. #include <engine>
  4. #include <fakemeta>
  5. #include <hamsandwich>
  6. #include <cstrike>
  7. #include <xs>
  8. #include <ze_zombie_class>
  9.  
  10. new const ball_name[] = "paralize_ball"
  11. new const ball_model[] = "models/w_hiddentail2.mdl"
  12. new const ball_soundtouch[] = { "warcraft3/frostnova.wav" }
  13.  
  14. new const zclass_name[] = { "Renevant Ice" } // name
  15. new const zclass_info[] = { "Trow ice grenade and freze human" } // description
  16. //new const zclass_model[] = { "revenant_ice" } // model
  17. //new const zclass_clawmodel[] = { "v_revenant_ice.mdl" } // claw model
  18. const zclass_health = 2000 // health
  19. const zclass_speed = 245 // speed
  20. const zclass_gravity = 600 // gravity
  21. //const Float:zclass_knockback = 1.0 // knockback
  22. //new const v_zombie_bomb_model[64] = "revenant_ice"
  23.  
  24. new g_CurWeapon[33], g_bombmodelwpn[64]
  25.  
  26. #define OFFSET_MODELINDEX 491
  27. #define OFFSET_LINUX 5
  28.  
  29. new index, defaultindex
  30.  
  31. new g_zclassparalize
  32. new cvar_paralizedelay , cvar_paralizevelocity , cvar_paralizeballhealth , cvar_paralizeballparalizetime
  33. new sTrail , g_touchs[512] , g_can[33] , g_paralizen[33]
  34.  
  35. native ze_is_user_nemesis(id)
  36.  
  37. new const WeaponNames[][] =
  38. {
  39. "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
  40. "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
  41. "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
  42. "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
  43. "weapon_ak47", "weapon_knife", "weapon_p90"
  44. }
  45.  
  46. public plugin_init()
  47. {
  48. register_plugin("[ZE] Zombie Class: Revenant Ice", "1.0", "=), LARS-BLOODLIKER")
  49.  
  50. cvar_paralizedelay = register_cvar("ze_classparalize_delay","15")
  51. cvar_paralizevelocity = register_cvar("ze_classparalizeball_velocity","1300")
  52. cvar_paralizeballhealth = register_cvar("ze_classparalizeball_health","5")
  53. cvar_paralizeballparalizetime = register_cvar ( "ze_classparalizeball_paralizetime", "7.0" )
  54.  
  55. register_touch(ball_name, "worldspawn", "touchWorld")
  56. register_touch(ball_name, "func_wall", "touchWorld")
  57. register_touch(ball_name, "func_door", "touchWorld")
  58. register_touch(ball_name, "func_door_rotating", "touchWorld")
  59. register_touch(ball_name, "func_wall_toggle", "touchWorld")
  60. register_touch(ball_name, "func_breakable", "touchWorld")
  61. register_touch(ball_name, "player", "touchPlayer")
  62. register_think(ball_name,"ball_think")
  63.  
  64. register_clcmd("drop","paralize_cmd")
  65. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  66. register_forward(FM_PlayerPreThink, "fw_PreThink")
  67.  
  68. RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
  69.  
  70. register_event("CurWeapon", "Event_CurrentWeapon", "be", "1=1")
  71.  
  72. for(new i = 1; i < sizeof WeaponNames; i++)
  73. if(WeaponNames[i][0]) RegisterHam(Ham_Item_Deploy, WeaponNames[i], "fw_Weapon_Deploy_Post", 1)
  74.  
  75. RegisterHam(Ham_Player_Duck, "player", "Player_Duck", 1)
  76. }
  77.  
  78. public plugin_precache()
  79. {
  80. precache_model(ball_model)
  81. sTrail = precache_model("sprites/laserbeam.spr")
  82.  
  83. g_zclassparalize = ze_register_zombie_class(zclass_name, zclass_info, zclass_health, zclass_speed, zclass_gravity)
  84.  
  85. //formatex(g_bombmodelwpn, charsmax(g_bombmodelwpn), "models/zombie_plague/v_bomb_%s.mdl", v_zombie_bomb_model)
  86. //engfunc(EngFunc_PrecacheModel, g_bombmodelwpn)
  87.  
  88. //index = precache_model("models/player/revenant_ice/revenant_ice.mdl")
  89. //defaultindex = precache_model("models/player.mdl")
  90. }
  91.  
  92. public paralize_cmd( id )
  93. {
  94. if( !is_user_alive(id) || !ze_is_user_zombie(id) || ze_get_current_zombie_class(id) != g_zclassparalize || ze_is_user_nemesis(id) )
  95. return PLUGIN_CONTINUE;
  96.  
  97. if(g_can[id])
  98. {
  99. client_print(id,print_center,"Востановление через %d секунд",g_can[id])
  100. return PLUGIN_HANDLED;
  101. }
  102.  
  103. static Float:origin[3], Float:angles[3], Float:v_forward[3], Float:v_right[3], Float:v_up[3], Float:gun_position[3], Float:player_origin[3], Float:player_view_offset[3];
  104. static Float:OriginX[3]
  105. pev(id, pev_v_angle, angles);
  106. pev(id, pev_origin, OriginX);
  107. engfunc(EngFunc_MakeVectors, angles);
  108.  
  109. global_get(glb_v_forward, v_forward);
  110. global_get(glb_v_right, v_right);
  111. global_get(glb_v_up, v_up);
  112.  
  113. //m_pPlayer->GetGunPosition( ) = pev->origin + pev->view_ofs
  114. pev(id, pev_origin, player_origin);
  115. pev(id, pev_view_ofs, player_view_offset);
  116. xs_vec_add(player_origin, player_view_offset, gun_position);
  117.  
  118. xs_vec_mul_scalar(v_forward, 13.0, v_forward);
  119. xs_vec_mul_scalar(v_right, 0.0, v_right);
  120. xs_vec_mul_scalar(v_up, 5.0, v_up);
  121.  
  122. xs_vec_add(gun_position, v_forward, origin);
  123. xs_vec_add(origin, v_right, origin);
  124. xs_vec_add(origin, v_up, origin);
  125.  
  126. new Float:StartOrigin[3]
  127.  
  128. StartOrigin[0] = origin[0];
  129. StartOrigin[1] = origin[1];
  130. StartOrigin[2] = origin[2];
  131.  
  132.  
  133. new Float:fVelocity[3] , Float:flOrigin[3] , Float:flAngle[3]
  134. pev(id,pev_origin,flOrigin)
  135. pev(id,pev_angles,flAngle)
  136.  
  137. new ball = create_entity("info_target")
  138.  
  139. if (!ball) return PLUGIN_HANDLED
  140.  
  141. g_touchs[ball] = 0
  142.  
  143. entity_set_string(ball, EV_SZ_classname, ball_name)
  144.  
  145. entity_set_model(ball, ball_model)
  146.  
  147. entity_set_origin(ball, StartOrigin)
  148.  
  149. entity_set_vector(ball, EV_VEC_angles, flAngle)
  150.  
  151. new Float:MinBox[3] = {-1.0, -1.0, -1.0}
  152. new Float:MaxBox[3] = {1.0, 1.0, 1.0}
  153. entity_set_vector(ball, EV_VEC_mins, MinBox)
  154. entity_set_vector(ball, EV_VEC_maxs, MaxBox)
  155.  
  156. entity_set_int(ball, EV_INT_solid, SOLID_SLIDEBOX)
  157.  
  158. entity_set_int(ball, EV_INT_movetype, MOVETYPE_BOUNCEMISSILE)
  159.  
  160. entity_set_edict(ball, EV_ENT_owner, id)
  161.  
  162. entity_set_int(ball, EV_INT_effects, EF_BRIGHTLIGHT)
  163.  
  164. VelocityByAim(id, get_pcvar_num(cvar_paralizevelocity ), fVelocity)
  165. entity_set_vector(ball , EV_VEC_velocity, fVelocity)
  166.  
  167. fm_set_rendering(ball, kRenderFxGlowShell,255, 255, 255, kRenderNormal, 16)
  168.  
  169. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  170. write_byte(TE_BEAMFOLLOW) // Temporary entity ID
  171. write_short(ball) // Entity
  172. write_short(sTrail) // Sprite index
  173. write_byte(10) // Life
  174. write_byte(3) // Line width
  175. write_byte(100) // Red
  176. write_byte(255) // Green
  177. write_byte(255) // Blue
  178. write_byte(255) // Alpha
  179. message_end()
  180.  
  181. UTIL_PlayPlayerAnimation(id,10)
  182. UTIL_PlayWeaponAnimation(id,8)
  183.  
  184. g_can[id] = get_pcvar_num(cvar_paralizedelay)
  185. set_task(1.0,"ability_zero",id)
  186.  
  187. entity_set_float(ball, EV_FL_health , get_pcvar_float(cvar_paralizeballhealth))
  188.  
  189. entity_set_float(ball, EV_FL_nextthink, get_gametime() + 0.1)
  190.  
  191. return PLUGIN_HANDLED;
  192. }
  193.  
  194. public touchWorld(ball, world) {
  195.  
  196. emit_sound(ball, CHAN_WEAPON, ball_soundtouch, 1.0, ATTN_NORM, 0, PITCH_NORM)
  197. g_touchs[ball] += 1
  198. if(g_touchs[ball] == get_pcvar_num(cvar_paralizeballhealth)) remove_entity(ball)
  199.  
  200. return PLUGIN_HANDLED
  201. }
  202.  
  203. public touchPlayer(ball, player) {
  204. client_print(0,print_chat,"Вы попали в %d",player)
  205. remove_task(player)
  206. paralize(player)
  207. //set_task(get_pcvar_float(cvar_paralizeballparalizetime),"unparalize_player",player)
  208.  
  209. return PLUGIN_HANDLED
  210. }
  211.  
  212. public event_round_start()
  213. {
  214. new iEnt = FM_NULLENT;
  215. while( (iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", ball_name)) > 0 )
  216. {
  217. engfunc(EngFunc_RemoveEntity,iEnt)
  218. }
  219.  
  220. for(new i;i<=32;i++)
  221. {
  222. if(g_paralizen[i]) fm_set_rendering(i)
  223. g_can[i] = 0
  224. g_paralizen[i] = 0
  225. remove_task(i)
  226. }
  227. }
  228.  
  229. public ball_think(ball)
  230. {
  231. if(!is_valid_ent(ball))
  232. return;
  233.  
  234. new Float:oldangles[3],Float:angles[3]
  235. pev(ball,pev_angles,oldangles)
  236. angles[0] = oldangles[0] + random_float(20.0,100.0)
  237. angles[1] = oldangles[1] + random_float(10.0,80.0)
  238. angles[2] = oldangles[2] + random_float(10.0,80.0)
  239. set_pev(ball,pev_angles,angles)
  240.  
  241. new Float:Velocity[3]
  242. pev(ball,pev_velocity,Velocity)
  243.  
  244. if(Velocity[0] < 1.0 && Velocity[2] < 1.0 && Velocity[1] < 1.0) remove_entity(ball)
  245.  
  246. entity_set_float(ball, EV_FL_nextthink, get_gametime() + 0.1)
  247.  
  248. }
  249.  
  250. public paralize(id)
  251. {
  252. if(!is_user_alive(id) || ze_is_user_zombie(id))
  253. return;
  254.  
  255. g_paralizen[id] = 1
  256. fm_set_rendering(id, kRenderFxGlowShell,100, 255, 255, kRenderNormal, 16)
  257. set_task(get_pcvar_float(cvar_paralizeballparalizetime),"unparalize_player",id)
  258. }
  259.  
  260. public unparalize_player(id)
  261. {
  262. if(!is_user_alive(id) || ze_is_user_zombie(id))
  263. return;
  264.  
  265. g_paralizen[id] = 0
  266. fm_set_rendering(id)
  267. }
  268.  
  269. public remove_values(id)
  270. {
  271. remove_task(id)
  272. g_can[id] = 0
  273. }
  274.  
  275. public ability_zero(id)
  276. {
  277. g_can[id] -= 1
  278. if(!g_can[id]) client_print(id,print_center,"Способность активна!")
  279. if(g_can[id]) set_task(1.0,"ability_zero",id)
  280. }
  281.  
  282. public fw_PreThink(id)
  283. {
  284. if( !is_user_alive(id) || ze_is_user_zombie(id) || !g_paralizen[id])
  285. return PLUGIN_CONTINUE;
  286.  
  287. set_pev( id, pev_button, pev(id,pev_button) & ~IN_ATTACK );
  288.  
  289. set_pev(id, pev_maxspeed, 0.0)
  290.  
  291. new Float:vel[3]
  292. set_pev(id,pev_velocity,vel)
  293.  
  294. return PLUGIN_HANDLED
  295. }
  296.  
  297. public ze_user_humanized(id)
  298. {
  299. fm_set_user_model_index(id, defaultindex)
  300.  
  301. remove_values(id)
  302. }
  303. public fw_PlayerKilled(id, attacker, shouldgib) remove_values(id)
  304. public client_connect(id) remove_values(id)
  305.  
  306. public ze_user_infected(id)
  307. {
  308. set_wpnmodel(id)
  309. if((ze_get_current_zombie_class(id) == g_zclassparalize) && (ze_is_user_zombie(id)))
  310. {
  311. fm_set_user_model_index(id, index)
  312. }
  313. remove_values(id)
  314. }
  315.  
  316. public ze_user_infected_pre(id)
  317. {
  318. if(!(get_user_flags(id) & ADMIN_LEVEL_H))
  319. {
  320. if(ze_get_next_zombie_class(id) == g_zclassparalize)
  321. {
  322. ze_set_next_zombie_class(id, 0)
  323. client_print(id, print_chat, "Данный класс только для Випов")
  324. client_print(id, print_chat, "Стоимость админки на месяц 100 рублей")
  325. }
  326. }
  327. }
  328.  
  329. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  330. {
  331. static Float:color[3]
  332. color[0] = float(r)
  333. color[1] = float(g)
  334. color[2] = float(b)
  335.  
  336. set_pev(entity, pev_renderfx, fx)
  337. set_pev(entity, pev_rendercolor, color)
  338. set_pev(entity, pev_rendermode, render)
  339. set_pev(entity, pev_renderamt, float(amount))
  340. }
  341.  
  342. stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
  343. {
  344. set_pev(Player, pev_weaponanim, Sequence)
  345.  
  346. message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
  347. write_byte(Sequence)
  348. write_byte(pev(Player, pev_body))
  349. message_end()
  350. }
  351.  
  352. stock UTIL_PlayPlayerAnimation(const id, const Sequence , Float:frame = 1.0 , Float:framerate = 1.0)
  353. {
  354. entity_set_int(id, EV_INT_sequence, Sequence)
  355. entity_set_int(id, EV_INT_gaitsequence, 1)
  356. entity_set_float(id, EV_FL_frame, frame)
  357. entity_set_float(id, EV_FL_framerate, framerate)
  358. }
  359.  
  360. stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
  361. {
  362. new_velocity[0] = origin2[0] - origin1[0]
  363. new_velocity[1] = origin2[1] - origin1[1]
  364. new_velocity[2] = origin2[2] - origin1[2]
  365. new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
  366. new_velocity[0] *= num
  367. new_velocity[1] *= num
  368. new_velocity[2] *= num
  369.  
  370. return 1
  371. }
  372.  
  373. stock fm_cs_set_user_deaths(id, value)
  374. {
  375. set_pdata_int(id, 444, value, 5)
  376. }
  377.  
  378. stock fm_cs_get_user_team(id)
  379. {
  380. return get_pdata_int(id, 114, 5);
  381. }
  382.  
  383. public Event_CurrentWeapon(id) g_CurWeapon[id] = read_data(2)
  384.  
  385. public fw_Weapon_Deploy_Post(weapon_ent)
  386. {
  387. static id; id = get_pdata_cbase(weapon_ent, 41, 4)
  388.  
  389. static weaponid; weaponid = cs_get_weapon_id(weapon_ent)
  390.  
  391. g_CurWeapon[id] = weaponid
  392.  
  393. replace_weapon_models(id, weaponid)
  394. }
  395.  
  396. public Player_Duck(id)
  397. {
  398. if(ze_get_current_zombie_class(id) == g_zclassparalize && ze_is_user_zombie(id))
  399. {
  400. static button, ducking
  401. button = pev(id, pev_button)
  402. ducking = pev(id, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
  403.  
  404. if(button & IN_DUCK || ducking)
  405. {
  406. set_pev(id, pev_view_ofs, {0.0, 0.0, 20.0})
  407. }
  408. }
  409. }
  410.  
  411. set_wpnmodel(id)
  412. {
  413. if(!is_user_alive(id)) return
  414.  
  415. new wpn = get_user_weapon(id)
  416.  
  417. if(wpn == CSW_HEGRENADE || wpn == CSW_FLASHBANG || wpn == CSW_SMOKEGRENADE)
  418. {
  419. set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  420. }
  421. }
  422.  
  423. replace_weapon_models(id, weaponid)
  424. {
  425. if(ze_get_current_zombie_class(id) == g_zclassparalize && ze_is_user_zombie(id))
  426. {
  427. switch(weaponid)
  428. {
  429. case CSW_HEGRENADE:
  430. {
  431. set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  432. }
  433. case CSW_SMOKEGRENADE:
  434. {
  435. set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  436. }
  437. case CSW_FLASHBANG:
  438. {
  439. set_pev(id, pev_viewmodel2, g_bombmodelwpn)
  440. }
  441. }
  442. }
  443. }
  444.  
  445. stock fm_set_user_model_index(id, value)
  446. {
  447. set_pdata_int(id, OFFSET_MODELINDEX, value, OFFSET_LINUX)
  448. }
Image

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: Ahrefs [Bot] and 11 guests