Member
|
11-21-2007
, 06:18
Errors when compiling, please help fast.
|
#1
|
Code:
/*
Human Dreadnought - Become a dreadnought and get a whole new arsenal of mighty weapons.
//Human Dreadnought
THANKS TO
Rolnaaba - For an awesome guide.
*/
#include <amxmodx>
#include <superheromod>
#include <cstrike>
#include <vexd_utilities>
new g_ak47_p_model
new g_m249_model
new g_awp_model
new g_ak47_model
new g_m4a1_model
new g_player_model
new gHeroName[]="Human Dreadnought"
new bool:gHasHumanDreadPower[SH_MAXSLOTS+1]
new humandread_set_model
//--------------------------------------------------------------------------------------------------
public plugin_init() {
register_plugin("SUPERHERO Human Dreadnought", "1.0", "B.A.N.G.E.R.S");
register_cvar("humandread_level", "10"); //level required to select hero
register_cvar("humandread_health", "150");
register_cvar("humandread_armor", "750");
register_cvar("humandread_mult", "1.5");
shCreateHero(gHeroName, "Weapon System", "Get a big arsenal of mighty weapons", false, "humandread_level"); //superheromod.inc: stock shCreateHero(heroName[], heroPower[], heroHelp[], bool:requiresKeyEvents, heroLevel[])
shSetMaxHealth(gHeroName, "humandread_health");
shSetMaxArmor(gHeroName, "humandread_armor");
register_event("Damage", "humandread_damage(id)","b");
register_srvcmd("Humandread_init", "Humandread_init"); //register your hero's init function with server
shRegHeroInit(gHeroName, "Humandread_init"); //register your hero's init with superheromod
}
//--------------------------------------------------------------------------------------------------
public plugin_precache() {
g_m4a1_model = precache_model("models/shero/humandread_v_m4a1");
g_awp_model = precache_model("models/shero/humandread_v_awp");
g_ak47_model = precache_model("models/shero/humandread_v_ak47");
g_ak47_p_model = precache_model("models/shero/humandread_p_ak47");
g_m249_model = precache_model("models/shero/humandread_v_m249");
g_player_model = precache_model("models/player/humandread/humandread");
}
//--------------------------------------------------------------------------------------------------
public Humandread_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);
gHasHumanDreadPower[id] = (hasPowers != 0); switch(hasPowers)
{
case true:
{
gHasHumanDreadPower[id] = true
if ( is_user_alive(id) )
{
humandread_weapons(id)
humandread_set_model(id)
humandread_tasks(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) && gHasHumanDreadPower[id] )
{
// This gets run if they had the power but don't anymore
engclient_cmd(id, "drop", "weapon_m4a1")
engclient_cmd(id, "drop", "weapon_ak47")
engclient_cmd(id, "drop", "weapon_m249")
engclient_cmd(id, "drop", "weapon_awp")
shRemHealthPower(id)
shRemArmorPower(id)
shRemGravityPower(id)
shRemSpeedPower(id)
}
gHasHumanDreadPower[id] = false
}
}
}
//--------------------------------------------------------------------------------------------------
humandread_tasks(id)
{
set_task(1.0, "humandread_set_model", id)
}
//--------------------------------------------------------------------------------------------------
public humandread_weapons(id)
{
if ( !shModActive() || !is_user_alive(id) || !gHasHumanDreadPower[id] )
return
shGiveWeapon(id, "weapon_m4a1")
shGiveWeapon(id, "weapon_m249")
shGiveWeapon(id, "weapon_awp")
shGiveWeapon(id, "weapon_ak47")
}
//--------------------------------------------------------------------------------------------------
public humandread_damage(id) {
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(attacker <= 0 || attacker > SH_MAXSLOTS ) return PLUGIN_CONTINUE; //checks ifs it was world that did the damage, and if so just end function.
if(gHasHumanDreadPower[attacker] && weapon == CSW_M4A1 && is_user_alive(id)) { //if alive and have power
if(gHasHumanDreadPower[attacker] && weapon == CSW_AWP && is_user_alive(id)) {
if(gHasHumanDreadPower[attacker] && weapon == CSW_M249 && is_user_alive(id)) {
if(gHasHumanDreadPower[attacker] && weapon == CSW_AK47 && is_user_alive(id)) {
new extraDamage = floatround(damage * get_cvar_float("humandread_mult") - damage); //calculate extra damage ([damage done x multiplier] - damage done = extra damage)
if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "m4a1", headshot )
if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "awp", headshot )
if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "ak47", headshot )
if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "m249", headshot )
}
}
}
//--------------------------------------------------------------------------------------------------
public humandread_set_model(id) {
if (!shModActive() || !is_user_alive(id) || !gHasHumanDreadPower[id]) return PLUGIN_CONTINUE; //if shmod if off, or they are dead, or the dont have the power end function
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo);
if(wpnid == CSW_M4A1)
{
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_m4a1_model));//view model
}
if(wpnid == CSW_M249)
{
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_m249_model));//view model
}
if(wpnid == CSW_AK47)
{
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_ak47_model));//view model
set_pev(id, pev_weaponmodel, engfunc(EngFunc_AllocString, g_ak47_p_model));//player model
}
if(wpnid == CSW_AWP)
{
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_awp_model));//view model
}
cs_set_user_model(id, g_player_model); //set player model
return PLUGIN_CONTINUE;
}
//--------------------------------------------------------------------------------------------------
That is the script, here comes the errors.
Code:
Error: Invalid function call, not a valid address on line 72
Warning: Expression has no effect on line 72
Error: Expected token: ";", but found ")" on line 72
Error: Invalid expression, assumed zero on line 72
Error: Too many error messages on one line on line 72
Compilation aborted.
4 Errors.
|
|