I need some help compiling this hero im making keeps erroring when i compile
Code:
//Guerilla Spartan! - Become a GuerillaSpartan AKA |Spartan|{IV}
//This hero was made was using jtpizzalover's superhero generator
/* CVARS - copy and paste to shconfig.cfg
//Guerilla Spartan
Guerilla Spartan_level 10
Guerilla Spartan_health 700 //Default 100 (no extra health)
Guerilla Spartan_armor 700 //Default 150
Guerilla Spartan_gravity 1 //Default 1.0 = no extra gravity (0.50 is 50% normal gravity, ect.)
Guerilla Spartan_speed 1000 //Default -1 = no extra speed, this cvar is for all weapons (for faster then normal speed set to 261 or higher)
Guerilla Spartan_augmult 5 //Damage multiplyer for his aug
*/
#include <amxmodx>
#include <superheromod>
#include <fakemeta>
new HeroName[] = "Guerilla Spartan"
new bool:HasHero[SH_MAXSLOTS+1]
new bool:HeroModelSet[SH_MAXSLOTS+1]
new CvaraugDmgMult
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Guerilla Spartan","amxx","&|Spartan|{IV}-Leader-&")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("Guerilla Spartan_level", "30")
register_cvar("Guerilla Spartan_health", "700")
register_cvar("Guerilla Spartan_armor", "700")
register_cvar("Guerilla Spartan_gravity", "1")
register_cvar("Guerilla Spartan_speed", "2000")
CvaraugDmgMult = register_cvar("Guerilla Spartan_augmult", "5")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(HeroName, "", "Become a GuerillaSpartan AKA |Spartan|{IV}", false, "Guerilla Spartan_level")
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("Guerilla Spartan_init", "Guerilla Spartan_init")
shRegHeroInit(HeroName, "Guerilla Spartan_init")
// EVENTS
register_event("ResetHUD", "new_spawn", "b")
register_event("DeathMsg", "Guerilla Spartan_death", "a")
register_event("CurWeapon", "weapon_change", "be", "1=1")
register_event("Damage", "Guerilla Spartan_damage", "b", "2!0")
// Let Server know about the hero's variables
shSetShieldRestrict(HeroName)
shSetMaxHealth(HeroName, "Guerilla Spartan_health")
shSetMaxArmor(HeroName, "Guerilla Spartan_armor")
shSetMinGravity(HeroName, "Guerilla Spartan_gravity")
shSetMaxSpeed(HeroName, "Guerilla Spartan_speed", "[0]")
}
public plugin_precache()
{
precache_model("models/shmod/Guerilla Spartan_v_aug.mdl")
precache_model("models/shmod/Guerilla Spartan_p_aug.mdl")
precache_model("models/shmod/Guerilla Spartan_w_aug.mdl")
precache_model("models/player/Guerilla Spartan/Guerilla Spartan.mdl")
}
public Guerilla Spartan_init()
{
// First Argument is an id
new temp[6]
read_argv(1, temp, 5)
new id = str_to_num(temp)
// 2nd Argument is 0 or 1 depending on whether the id has the hero
read_argv(2, temp, 5)
new hasPowers = str_to_num(temp)
//This hero was made was using jtpizzalover's superhero generator
// Reset their shield restrict status
// Shield restrict MUST be before weapons are given out
shResetShield(id)
switch(hasPowers)
{
case true:
{
HasHero[id] = true
if ( is_user_alive(id) )
{
Guerilla Spartan_weapons(id)
switch_model(id)
}
}
case false:
{
// Check is needed since this gets run on clearpowers even if user didn't have this hero
if ( is_user_alive(id) && HasHero[id] )
{
// This gets run if they had the power but don't anymore
engclient_cmd(id, "drop", "weapon_aug")
Guerilla Spartan_unmorph(id)
shRemHealthPower(id)
shRemArmorPower(id)
shRemGravityPower(id)
shRemSpeedPower(id)
}
HasHero[id] = false
}
}
}
public new_spawn(id)
{
if ( shModActive() && is_user_alive(id) && HasHero[id] )
{
set_task(0.1, "Guerilla Spartan_weapons", id)
Guerilla Spartan_tasks(id)
}
}
Guerilla Spartan_tasks(id)
{
set_task(1.0, "Guerilla Spartan_morph", id)
}
public Guerilla Spartan_weapons(id)
{
if ( !shModActive() || !is_user_alive(id) || !HasHero[id] )
return
shGiveWeapon(id, "weapon_aug")
}
switch_model(id)
{
if ( !shModActive() || !is_user_alive(id) || !HasHero[id] )
return
new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
if ( wpnid == CSW_AUG )
{
set_pev(id, pev_viewmodel2, "models/shmod/Guerilla Spartan_v_aug.mdl")
set_pev(id, pev_weaponmodel2, "models/shmod/Guerilla Spartan_w_aug.mdl")
}
}
public weapon_change(id)
{
if ( !shModActive() || !HasHero[id] )
return
new wpnid = read_data(2)
if ( wpnid != CSW_AUG )
return
switch_model(id)
new clip = read_data(3)
// Never Run Out of Ammo!
if ( clip == 0 )
shReloadAmmo(id)
}
public Guerilla Spartan_damage(id)
{
if ( !shModActive() || !is_user_alive(id) )
return
new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
if ( attacker <= 0 || attacker > SH_MAXSLOTS )
return
if ( HasHero[attacker] && weapon == CSW_AUG && is_user_alive(id) )
{
new damage = read_data(2)
new headshot = bodypart == 1 ? 1 : 0
// do extra damage
new extraDamage = floatround(damage * get_pcvar_float(CvaraugDmgMult) - damage)
if ( extraDamage > 0 )
shExtraDamage(id, attacker, extraDamage, "aug", headshot)
}
}
public Guerilla Spartan_morph(id)
{
if ( HeroModelSet[id] || !is_user_alive(id) || !HasHero[id] )
return
cs_set_user_model(id, "Hero")
HeroModelSet[id] = true
}
Guerilla Spartan_unmorph(id)
{
if ( HeroModelSet[id] && is_user_connected(id) )
{
cs_reset_user_model(id)
HeroModelSet[id] = false
}
}
public Guerilla Spartan_death()
{
new id = read_data(2)
if ( !HasHero[id] )
return
Guerilla Spartan_unmorph(id)
}
public client_connect(id)
{
HasHero[id] = false
HeroModelSet[id] = false
}