Hello!
So i tried to make this class can't take any damage from head with helmet sound, its so simple but the only thing that i get is this error:
Quote:
Warning: Loose indentation on line 33
Error: Number of arguments does not match definition on line 63
|
I tried all day and this is what i have reached so far. Can any one give me a hand please
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <cs_ham_bots_api>
#include <zp50_class_zombie>
#include <zombieplague>
#include <ColorChat>
#define HIT_SHIELD 8
new const zombieclass1_name[] = "Tanker Zombie"
new const zombieclass1_info[] = "=No Headshots="
new const zombieclass1_models[][] = { "zpm_headless" }
new const zombieclass1_clawmodels[][] = { "models/zombie_plague/v_knife_zombie.mdl" }
const zombieclass1_health = 2800
const Float:zombieclass1_speed = 0.80
const Float:zombieclass1_gravity = 0.9
const Float:zombieclass1_knockback = 1.0
new g_ZombieClassID
new g_iMaxPlayers
new g_cvarSHelmetThreshold
public plugin_init()
{
register_plugin("[ZP] Class: Tanker Zombie", "1.0", "Hn.S")
RegisterHam(Ham_TraceAttack, "player", "fw_traceattack")
RegisterHamBots(Ham_TraceAttack, "fw_traceattack")
register_forward(FM_TraceLine, "fw_traceattack", 1)
g_iMaxPlayers = get_maxplayers()
g_cvarSHelmetThreshold = register_cvar("zp_class_tanker_head", "0")
}
public plugin_precache()
{
new index
g_ZombieClassID = zp_class_zombie_register(zombieclass1_name, zombieclass1_info, zombieclass1_health, zombieclass1_speed, zombieclass1_gravity)
zp_class_zombie_register_kb(g_ZombieClassID, zombieclass1_knockback)
for (index = 0; index < sizeof zombieclass1_models; index++)
zp_class_zombie_register_model(g_ZombieClassID, zombieclass1_models[index])
for (index = 0; index < sizeof zombieclass1_clawmodels; index++)
zp_class_zombie_register_claw(g_ZombieClassID, zombieclass1_clawmodels[index])
}
public fw_traceattack(victim, attacker,Float:v1[3], Float:v2[3], fNoMonsters, pentToSkip, ptr)
{
if(!is_user_alive(victim) || zp_class_zombie_get_current(victim) != g_ZombieClassID)
return
static iHitEnt; iHitEnt = get_tr2(ptr, TR_pHit)
if(1 <= iHitEnt <= g_iMaxPlayers)
{
static iArmor
static CsArmorType:tArmor
iArmor = zp_get_user_zombie(iHitEnt, tArmor)
if(iArmor > 0 && tArmor == CS_ARMOR_VESTHELM
&& get_tr2(ptr, TR_iHitgroup) == HIT_HEAD)
{
iHitEnt = get_pcvar_num(g_cvarSHelmetThreshold) // re-use iHitEnt
if(iHitEnt > 0 && iArmor >= iHitEnt)
iHitEnt = HIT_SHIELD
else
iHitEnt = HIT_GENERIC
set_tr2(ptr, TR_iHitgroup, iHitEnt)
}
}
//return FMRES_SUPERCEDE
}
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(id) == g_ZombieClassID)
{
ColorChat(id, GREEN, "^x01[^x04ZPM^x01] You're class is ^x04[^x01 Tanker Zombie ^x04]^x01 Your Skills :^x03 No Headshots.")
}
}