Hello. I'm trying to add health regeneration ability to the Boomer zombie class.
I transferred some codes from the .sma file of the regeneration zombie to the .sma file of the boomer zombie. One of the code causes some problems.
The following errors:
// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : error 017: undefined symbol "set_pev"
// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : error 001: expected token: ";", but found ")"
// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : error 029: invalid expression, assumed zero
// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : fatal error 107: too many error messages on one line
Are caused by the line 107 in this code
(the line is marked in red):
Code:
public Regenerate(player)
{
if (!get_pcvar_num(g_zclass_regen_toggle) || !is_user_alive(player) || !zp_get_user_zombie(player))
return PLUGIN_CONTINUE
if (zp_get_user_zombie_class(player) != g_zclass_Regen)
return PLUGIN_CONTINUE
new regen_health = get_user_health(player)
new max_health = zp_get_zombie_maxhealth(player) - regen_health
if (max_health <= get_pcvar_num(g_amount))
{
set_pev(player, pev_health, regen_health + float(max_health))
remove_task(player)
}
set_pev(player, pev_health, regen_health + get_pcvar_float(g_amount))
return PLUGIN_CONTINUE
}
Can someone explain to me why does this line causes these errors? I don't see anything wrong with the line. It works when used in the Regeneration zombie, but doesn't work when inserted in the .sma file of the Boomer zombie.
Would someone explain to he how to fix this error?