You need to post the errors too. But Ill look into it.
EDIT:
You have a really messed up code. If you see what I did in your plugin_init
Code:
// Heavy
/* CVARS - copy and paste to shconfig.cfg
//Heavy
heavy_level 25 //The level of the hero Default: 25
heavy_healpoints 20 // the #of HP healed per second
YodaMan_knifespeed 670 // speed of Darth Maul in knife mode
YodaMan_knifemult 2.70 // multiplier for knife damage...
*/
/*
*
*
* Heavy with a minigun from TF2
*/
#include <amxmodx>
#include <superheromod>
#include <fakemeta> //for model setting
new g_p_model; //must be outside plugin_init so it can be global
new g_v_model;
new gHeroName[]="Heavy" //creates a string varr to hold your hearo's name
new bool:gHasSuperPower[SH_MAXSLOTS+1] //creates a varr with an aray, with 1 slot per player
public plugin_init() {
register_plugin("SUPERHERO Heavy", "UNKNOWN", "Lyserinc"); //register plugin (you should know what this is)
//cvars
register_cvar("Heavy_level", "25"); //level required to select hero
register_cvar("Heavy_health", "500"); //cvar for health
register_cvar("Heavy_armor", "1000"); //cvar for armor
register_cvar("Heavy_mult", "4.0"); //cvar for damage
shCreateHero(gHeroName, "Hero Power List", "Hero Discription", false, "Heavy_level");
//superheromod.inc:
//stock shCreateHero(heroName[], heroPower[], heroHelp[], bool:requiresKeyEvents, heroLevel[])
register_srvcmd("Heavy_init", "Heavy_init"); //register your hero's init function with server
shRegHeroInit(gHeroName, "Heavy_init"); //register your hero's init with superheromod
//set functions
shSetMaxHealth(gHeroName, "Heavy_health"); //set health
shSetMaxArmor(gHeroName, "Heavy_armor"); //set armor
//...
//see helpful links for event info
register_event("Damage", "Event_damage","b");
}
public Heavy_init() {
new temp[6]; //declare a temperary varriable
read_argv(1,temp,5); //reading the first argument will give you the id of the person who selected your hero
new id = str_to_num(temp); //transfer the string returned into a number and store it as the id
read_argv(2,temp,5); //second argument is whether they have the power or not
new hasPowers = str_to_num(temp);
gHasSuperPower[id] = (hasPowers != 0); //(hasPowers != 0) will either return 1 (if it is true that hasPowers != 0), or 0 (if it is false that hasPowers != 0)
//...
if (!hasPowers && gHasSuperPower[id] && is_user_alive(id)) { //check if they had power but dont know and are alive
shRemHealthPower(id); //remove health power if this is the case
//...
if (!hasPowers && gHasSuperPower[id] && is_user_alive(id)) { //check if they had power but dont know and are alive
shRemArmorPower(id); //remove armor power if this is the case
if (!shModActive() || !is_user_alive(id)) return PLUGIN_CONTINUE;
new damage = read_data(2); //this is covered in my events tut. (in helpful links)
new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart) //store what weapon used, bodypart hit, and attacker
new headshot = bodypart == 1 ? 1 : 0 //this is just short for:
/*if (bodypart == 1) {
headshot = 1;
} else {
headshot = 0;
}*/
if(attacker <= 0 || attacker > SH_MAXSLOTS ) return PLUGIN_CONTINUE; //checks ifs it was world that did the damage, and if so just end function.
if(gHasSuperPower[attacker] && is_user_alive(id)) { //if alive and have power
new extraDamage = floatround(damage * get_cvar_float("Super_mult") - damage); //calculate extra damage ([damage done x multiplier] - damage done = extra damage)
if (extraDamage > 0) {
shExtraDamage( id, attacker, extraDamage, "Super damage Mult", headshot ); //superheromod.inc: stock shExtraDamage(id, attacker, damage, weaponDescription[], headshot = 0);
//...
if(hasPowers) { //if they have power
Heavy_set_model(id) //go to set model funciton
}
//...
}
}
}
public plugin_precache() {
//...
g_p_model = precache_model("models/shmod/Super/p_m249.mdl"); //makes players download the model
g_v_model = precache_model("models/shmod/Super/v_m249.mdl");
}
public Heavy_set_model(id) {
if (!shModActive() || !is_user_alive(id) || !HasSuperPower[id]) return;
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo);
if(wpnid == WEAPON_ID_TO_CHANGE) {
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_v_model));//view model
set_pev(id, pev_weaponmodel, engfunc(EngFunc_AllocString, g_p_model));//player model
}
}
You see how I cleaned it up for you? Do that with everything in your code and it will be so much easier to read for yourself, and for everyone else who looks at it.
Try look at your own code, clean it up so it looks nice and easy to read.
After what I can see, you just copy paste what is written in the tutorial thread. You need to write it YOURSELF, and make the code clean from scratch, or else you wont really learn anything from it.
Do you even know what you have done so far?