I was trying to make a custom hero to min but had compilation error,I did like explaining the topic but still gave error
PHP Code:
//Hatsune
/* CVARS - copy and paste to shconfig.cfg
//Hatsune
hatsune_level 12 (Default:12)
hatsune_health 480 (Default: 480)
hatsune_armor 250 (Default: 250)
hatsune_grav 0.35 (Default: 0.35)
hatsune_speed 395 (Default: 395)
hatsune_ak47mult 3.5 (Default: 395)
*/
#include <superheromod>
#include <amxmodx>
new gHeroID
new gHeroName[] = "Hatsune"
new bool:gHasHatsunePower[SH_MAXSLOTS+1]
new const gHatsuneWeapon[] = "models/shmod/ak47_hatsune.mdl"
new const gHatsunePlayer[] = "models/player/shmod/hatsune/hatsune.mdl"
//--------------------------------------------------------------------------------------------------
public plugin_init()
{
register_plugin("SUPERHERO hatsune", "1.0", "Hatsune")
//--------------------------------------------------------------------------------------------------
new pcvarLevel = register_cvar("hatsune_level", "12")
gHeroID = sh_create_hero(gHeroName, pcvarLevel)
sh_set_hero_info(gHeroID, "VIP", "More HP, More AP, Lowest Gravity, Super Speed and AK47 Unlimited ammo and More damage")
//--------------------------------------------------------------------------------------------------
new pcvarHealth = register_cvar("hatsune_health", "480")
sh_set_hero_hpap(gheroID, pcvarHealth, 0)
//--------------------------------------------------------------------------------------------------
new pcvarArmor = register_cvar("hatsune_armor", "250")
sh_set_hero_hpap(gheroID, 0, pcvarArmor)
//--------------------------------------------------------------------------------------------------
new pcvarGrav = register_cvar("hatsune_grav", "0.35")
sh_set_hero_grav(gHeroID, pcvarGrav)
//--------------------------------------------------------------------------------------------------
new pcvarSpeed = register_cvar("hatsune_speed", "395")
sh_set_hero_speed(gHeroID, pcvarSpeed)
//--------------------------------------------------------------------------------------------------
new pcvarMult = register_cvar("hatsune_ak47mult", "3.5")
sh_set_hero_dmgmult(gHeroID, pcvarMult, CSW_AK47)
register_event("CurWeapon", "weapon_change", "be", "1=1")
//--------------------------------------------------------------------------------------------------
}
//--------------------------------------------------------------------------------------------------
public sh_hero_init(id, heroID, mode)
{
if (gHeroID != heroID) return
switch(mode)
{
case SH_HERO_ADD:
{
//--------------------------------------------------------------------------------------------------
gHasHatsunePower[id] = true
}
case SH_HERO_DROP:
{
gHasHatsunePower[id] = false
}
//--------------------------------------------------------------------------------------------------
switch (mode)
{
case SH_HERO_ADD:
{
gHasHatsunePower[id] = true
hatsune_weapon(id)
switch_model(id)
}
//--------------------------------------------------------------------------------------------------
case SH_HERO_DROP:
{
gHasHatsunePower[id] = false
if (is_user_alive(id))
{
sh_drop_weapon(id, CSW_AK47, true)
}
}
}
}
//--------------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
if (gHasHatsunePower[id])
{
hatsune_weapon(id)
}
}
//--------------------------------------------------------------------------------------------------
hatsune_weapon(id)
{
if (sh_is_active() && is_user_alive(id) && gHasHatsunePower[id] )
{
sh_give_weapon(id, CSW_AK47)
}
}
//--------------------------------------------------------------------------------------------------
public weapon_change(id)
{
if ( !sh_is_active() || !gHasHatsunePower[id] ) return
new weaponID = read_data(2)
if (weaponID !=CSW_AK47) return
switch_model(id)
if (read_data(3) == 0)
{
sh_reload_ammo(id, 1)
}
}
//--------------------------------------------------------------------------------------------------
switch_model(id)
{
if (!sh_is_active() || !is_user_alive(id) || !gHasHatsunePower[id] ) return
if (get_user_weapon(id) == CSW_AK47)
{
set_pev(id, pev_viewmodel2, gHatsuneWeapon)
}
}
and this is the error
http://prntscr.com/ap30i9
Sorry if my English is wrong.