HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4. #include <zombieplague>
  5.  
  6.  
  7. new const PLUGIN[] = "[ZP] Class Legy";
  8. new const VERSION[] = "1.0";
  9. new const AUTHOR[] = "VirTuaL .";
  10.  
  11.  
  12. new g_zclass_legy
  13. new bool:has_jp[33];
  14.  
  15. new const CVAR_JP_SPEED[] = "jp_speed";
  16.  
  17.  
  18. // Fly Zombie Attributes
  19. new const zclass_name[] = { "Legy Zombi" } // name
  20. new const zclass_info[] = { "\rRepul,Kicsi Modell,100 HP" } // description
  21. new const zclass_model[] = { "class_legy" } // model
  22. new const zclass_clawmodel[] = { "v_knife_legy.mdl" } // claw model
  23. const zclass_health = 100 // health
  24. const zclass_speed = 250 // speed
  25. const Float:zclass_gravity = 0.6 // gravity
  26. const Float:zclass_knockback = 2.0 // knockback
  27.  
  28.  
  29. public plugin_init()
  30. {
  31. register_plugin(PLUGIN , VERSION , AUTHOR);
  32. register_cvar(CVAR_JP_SPEED , "250");
  33. }
  34.  
  35. public plugin_precache()
  36. {
  37. g_zclass_legy = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
  38.  
  39. }
  40.  
  41. public client_PreThink(id)
  42. {
  43. if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
  44. if(zp_get_user_zombie_class(id) != g_zclass_legy) return PLUGIN_CONTINUE
  45.  
  46. new Float:fAim[3] , Float:fVelocity[3];
  47. VelocityByAim(id , get_cvar_num(CVAR_JP_SPEED) , fAim);
  48.  
  49. if(!(get_user_button(id) & IN_JUMP))
  50. {
  51. fVelocity[0] = fAim[0];
  52. fVelocity[1] = fAim[1];
  53. fVelocity[2] = fAim[2];
  54.  
  55. set_user_velocity(id , fVelocity);
  56. fm_set_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16);
  57. }
  58. return PLUGIN_CONTINUE;
  59. }
  60.  
  61.  
  62. // User Infected forward
  63. public zp_user_infected_post(id, infector)
  64. {
  65. if (zp_get_user_zombie_class(id) == g_zclass_legy)
  66. {
  67. client_print(id,print_chat,"[ZP] Te Legy Zombi vagy!")
  68. has_jp[id] = true
  69. }
  70. }
  71.  
  72. // Set entity's rendering type (from fakemeta_util)
  73. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  74. {
  75. static Float:color[3]
  76. color[0] = float(r)
  77. color[1] = float(g)
  78. color[2] = float(b)
  79.  
  80. set_pev(entity, pev_renderfx, fx)
  81. set_pev(entity, pev_rendercolor, color)
  82. set_pev(entity, pev_rendermode, render)
  83. set_pev(entity, pev_renderamt, float(amount))
  84. }