Hey, Jelle, please, can u help me??.
I write all the code like u talk in the tutorial...
I used all the functions that u talk in this tutorial..
But when i go compile i got this errors:
Quote:
warning 217: loose indentation <31>
warning 217: loose indentation <42>
error 017: undefined symbol "stick_weapon" <68>
error 017: undefined symbol "stick_weapon" <100>
error 017: undefined symbol "stick_weapon" <106>
error 021: symbol already defined: "cs_set_user_model" <109>
error 010: invalid function or declaration <110>
error 021: symbol already defined: "sh_give_weapon" <113>
error 054: unmatched closing brace <119>
|
Can you, Jelle, or you guys help me fixing this code or talking whats happened to me fix the code...
I'm much thanks if u guys can help me....
The code:
Code:
// Stick - Hp, Gravity, Armor, Speed, Gun!
/* CVARS - copy and paste to shconfig.cfg
//Stick
Stick_level 12 //Stick Level
Stick_health 750 //Stick Health
Stick_armor 100 //Stick Armor
Stick_grav 0.50 //Stick Gravity
Stick_speed 400 //Stick Speed
Stick_mult 3.0 //Stick Damage mult
*/
#include <superheromod>
// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Stick"
new bool:gHasStickPower[SH_MAXSLOTS+1]
new const gStickPlayer[] = "models/player/Stick/Stick.mdl"
new const gStickWeapon[] = "models/shmod/v_Stick_AK47.mdl"
new const gStickWeapon2[] = "models/shmod/p_Stick_AK47.mdl"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Stick", "1.0", "[SN]KyLava")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
new pcvarLevel = register_cvar("Stick_level", "12")
new pcvarHealth = register_cvar("Stick_health", "750")
new pcvarArmor = register_cvar("Stick_armor", "100")
new pcvarGrav = register_cvar("Stick_grav", "0.50")
new pcvarSpeed = register_cvar("Stick_speed", "400")
new pcvarMult = register_cvar("Stick_mult", "3.0")
// This is what creates the hero remember the pcvarLevel is pointing at the level for the hero
gHeroID = sh_create_hero(gHeroName, pcvarLevel)
// EVENTS
register_event("CurWeapon", "weapon_change", "be", "1=1")
//This is setting the hero info. It pretty much explains itself
sh_set_hero_info(gHeroID, "Hp, Gravity, Armor, Speed, Gun!", "More Health and Armor, Super Speed and Models")
sh_set_hero_hpap(gHeroID, pcvarHealth, pcvarArmor)
sh_set_hero_grav(gHeroID, pcvarGrav)
sh_set_hero_speed(gHeroID, pcvarSpeed)
sh_set_hero_dmgmult(gHeroID, pcvarMult, CSW_AK47)
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(id, heroID, mode)
{
if (gHeroID != heroID) return
switch(mode)
{
//If The Hero is added
case SH_HERO_ADD:
{
gHasStickPower[id] = true
stick_morph(id)
stick_weapon(id)
switch_model(id)
}
case SH_HERO_DROP:
{
gHasStickPower[id] = false
stick_unmorph(id)
if (is_user_alive(id))
{
sh_drop_weapon(id, CSW_AK47, true)
}
}
}
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model(gStickPlayer)
precache_model(gStickWeapon)
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
if (gHasStickPower[id])
{
stick_morph(id)
stick_weapon(id)
}
}
stick_morph(id)
stick_weapon(id)
{
cs_set_user_model(id, "stick")
if (sh_is_active() && is_user_alive(id) && gHasStickPower[id] )
{
sh_give_weapon(id, CSW_AK47)
stick_unmorph(id)
{
cs_reset_user_model(id)
}
}
}
//----------------------------------------------------------------------------------------------
public weapon_change(id)
{
if ( !sh_is_active() || !gHasStickPower[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) || !gHasStickPower[id] ) return
if (get_user_weapon(id) == CSW_AK47)
{
set_pev(id, pev_viewmodel2, gStickWeapon)
set_pev(id, pev_weaponmodel2, gStickWeapon2)
}
}
//----------------------------------------------------------------------------------------------