Установил зомби-класс вороны (способность летать), только проблема в том что если с этим классом стать немезидой, то и немезида будет летать
пытался исправить сам - не получается у меня
Буду очень благодарен за помощь!
пытался исправить сам - не получается у меня
Буду очень благодарен за помощь!
Код:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <zombieplague>
#include <zp50_class_nemesis>
new const PLUGIN[] = "[ZP] CROW ZOMBIE";
new const VERSION[] = "1.0";
new const AUTHOR[] = "v3x+Roadrage";
new g_zclass_crow
new bool:has_jp[33];
new const CVAR_JP_SPEED[] = "jp_speed";
// Crow Zombie Atributes
new const zclass_name[] = { "Crow Zombie" } // name
new const zclass_info[] = { "Can Fly" } // description
new const zclass_model[] = { "crow" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
new cvar_NemesisFly
const zclass_health = 100 // health
const zclass_speed = 250 // speed
const Float:zclass_gravity = 0.6 // gravity
const Float:zclass_knockback = 2.0 // knockback
public plugin_init()
{
register_plugin(PLUGIN , VERSION , AUTHOR);
register_cvar(CVAR_JP_SPEED , "250");
cvar_NemesisFly = register_cvar("zp_fly_nemesis", "0")
}
public plugin_precache()
{
g_zclass_crow = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public client_PreThink(id)
{
if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
if(zp_get_user_zombie_class(id) != g_zclass_crow) return PLUGIN_CONTINUE
new Float:fAim[3] , Float:fVelocity[3];
VelocityByAim(id , get_cvar_num(CVAR_JP_SPEED) , fAim);
if(!(get_user_button(id) & IN_JUMP))
{
fVelocity[0] = fAim[0];
fVelocity[1] = fAim[1];
fVelocity[2] = fAim[2];
set_user_velocity(id , fVelocity);
fm_set_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16);
}
return PLUGIN_CONTINUE;
}
// User Infected forward
public zp_user_infected_post(id, infector, NemesisFly)
{
if (NemesisFly && !get_pcvar_num(cvar_NemesisFly)) return
if (zp_get_user_zombie_class(id) == g_zclass_crow)
{
client_print(id,print_chat,"Для полета нажми пробел")
has_jp[id] = true
}
}
// Set entity's rendering type (from fakemeta_util)
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color[3]
color[0] = float(r)
color[1] = float(g)
color[2] = float(b)
set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, color)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))
}
Код:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <zombieplague>
new const PLUGIN[] = "[ZP] CROW ZOMBIE";
new const VERSION[] = "1.0";
new const AUTHOR[] = "v3x+Roadrage";
new g_zclass_crow
new bool:has_jp[33];
new const CVAR_JP_SPEED[] = "jp_speed";
// Crow Zombie Atributes
new const zclass_name[] = { "Crow Zombie" } // name
new const zclass_info[] = { "Can Fly" } // description
new const zclass_model[] = { "crow" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 100 // health
const zclass_speed = 250 // speed
const Float:zclass_gravity = 0.6 // gravity
const Float:zclass_knockback = 2.0 // knockback
public plugin_init()
{
register_plugin(PLUGIN , VERSION , AUTHOR);
register_cvar(CVAR_JP_SPEED , "250");
}
public plugin_precache()
{
g_zclass_crow = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public client_PreThink(id)
{
if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
if(zp_get_user_zombie_class(id) != g_zclass_crow) return PLUGIN_CONTINUE
new Float:fAim[3] , Float:fVelocity[3];
VelocityByAim(id , get_cvar_num(CVAR_JP_SPEED) , fAim);
if(!(get_user_button(id) & IN_JUMP))
{
fVelocity[0] = fAim[0];
fVelocity[1] = fAim[1];
fVelocity[2] = fAim[2];
set_user_velocity(id , fVelocity);
fm_set_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16);
}
return PLUGIN_CONTINUE;
}
// User Infected forward
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(id) == g_zclass_crow)
{
client_print(id,print_chat,"[ZP] You are using crow zombie hold jump to fly")
has_jp[id] = true
}
}
// Set entity's rendering type (from fakemeta_util)
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color[3]
color[0] = float(r)
color[1] = float(g)
color[2] = float(b)
set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, color)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))
}