Сделал класс зомби у которого востанавливается здоровье:
Код:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <zp50_class_zombie>
#define PLUGIN "[ZP] Class: Fat Zombie"
#define VERSION "1.0"
#define AUTHOR "THE-Swank"
#define HEALING_AMOUNT 30.0
#define HEALING_DELAY 2.0
new const class_name[] = "Fat Zombie"
new const class_info[] = "HP++ HP regen+ Speed- Knockback--"
new const class_models[][] = { "zombie_fat" }
new const class_clawmodels[][] = { "models/zombie_plague/v_knife_zombie_fat.mdl" }
const class_health = 3000
const Float:class_speed = 0.80
const Float:class_gravity = 1.0
const Float:class_knockback = 3.25
new g_ZombieClassID
new Float:g_HealingDelay[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Damage", "damage", "be")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
}
public plugin_precache()
{
new index
g_ZombieClassID = zp_class_zombie_register(class_name, class_info, class_health, class_speed, class_gravity)
zp_class_zombie_register_kb(g_ZombieClassID, class_knockback)
for (index = 0; index < sizeof class_models; index++)
zp_class_zombie_register_model(g_ZombieClassID, class_models[index])
for (index = 0; index < sizeof class_clawmodels; index++)
zp_class_zombie_register_claw(g_ZombieClassID, class_clawmodels[index])
}
public damage(player)
{
if (!is_user_alive(player) || !zp_get_user_zombie(player))
return PLUGIN_HANDLED
if (zp_get_user_zombie_class(player) != g_ZombieClassID)
return PLUGIN_CONTINUE
static Float:g_GameTime
g_GameTime = get_gametime()
g_HealingDelay[player] = g_GameTime + HEALING_DELAY
return PLUGIN_CONTINUE
}
public fw_PlayerPreThink(player)
{
if (!is_user_alive(player) || !zp_get_user_zombie(player))
return FMRES_IGNORED
if (zp_get_user_zombie_class(player) != g_ZombieClassID)
return FMRES_IGNORED
static Float:g_GameTime, Float:g_Health
g_GameTime = get_gametime()
pev(player, pev_health, g_Health)
if (g_Health < class_health && g_HealingDelay[player] < g_GameTime) {
set_pev(player, pev_health, g_Health + HEALING_AMOUNT)
g_HealingDelay[player] = g_GameTime + HEALING_DELAY
}
return FMRES_IGNORED
}
Здоровье востанавливается но в меню выбора класса зомби в его описании следуйщие "HP++ Speed- Knockback--", хотя я в скрипте написал "HP++ HP regen+ Speed- Knockback--", также не устанавлюются модели.
В чем может быть проблема?