Member
|
03-31-2008
, 03:35
Models won't change for unknown reason...
|
#1
|
Well i have this hero, and i have looked at it multiple times to try to find out why the models aren't changing, compared it to heroes i have made where the models do change, and i still don't see why it's not working, can anyone see what the problem is?
Code:
/* Plugin generated by AMXX-Studio */
/*
//Five-0 Cvars
five0_level 30
five0_health 500 //How much health Five-0 has (Def. 500)
five0_armor 500 //How much armor Five-0 has (Def. 500)
five0_glockmult 3.0 //How much damage Five-0's glock does (Def. 3.0)
five0_mp5mult 3.0 //How Much damage Five-0's mp5 does (Def. 3.0)
*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <superheromod>
#define PLUGIN "Five-0"
#define VERSION "1.0"
#define AUTHOR "Vendetter"
new HeroName[] = "Five-0"
new bool:HasFive0[SH_MAXSLOTS+1]
new Float:gPunchAngle[3] = {0.0,0.0,0.0}
public plugin_init()
{
register_plugin("Five-0", "1.0", "Vendetter")
//Hero
shCreateHero(HeroName, "Glock and MP5", "Rock Out with you Glock Out!", false, "five0_level")
register_srvcmd("five0_init", "five0_init")
shRegHeroInit(HeroName, "five0_init")
//Cvars
register_cvar("five0_level", "30")
register_cvar("five0_armor", "500")
register_cvar("five0_health", "500")
register_cvar("five0_glockmult", "3.0")
register_cvar("five0_mp5mult", "3.0")
//Events
register_event("CurWeapon", "weapon_change", "be", "1=1")
register_event("ResetHUD", "new_spawn", "b")
register_event("Damage", "event_damage", "b")
//Power Sets
shSetMaxArmor(HeroName, "five0_armor")
shSetMaxHealth(HeroName, "five0_health")
}
public plugin_precache()
{
precache_model("models/shmod/five0_v_glock18.mdl")
precache_model("models/shmod/five0_v_mp5navy.mdl")
}
public five0_init(id)
{
new temp[6];
read_argv(1,temp,5);
new id =str_to_num(temp);
read_argv(2,temp,5);
new hasPowers = str_to_num(temp);
shResetShield(id)
switch(hasPowers)
{
case true:
{
HasFive0[id] = true
if( is_user_alive(id) )
{
five0_weapons(id)
switch_model(id)
}
}
case false:
{
if( is_user_alive(id) && HasFive0[id] )
{
shRemArmorPower(id)
shRemHealthPower(id)
engclient_cmd(id, "drop", "weapon_glock")
engclient_cmd(id, "drop", "weapon_mp5")
}
HasFive0[id] = false
}
}
}
switch_model(id)
{
if ( !shModActive() || !is_user_alive(id) || !HasFive0[id] )
return
new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
if ( wpnid == CSW_MP5NAVY )
{
set_pev(id, pev_viewmodel2, "models/shmod/five0_v_mp5navy.mdl")
}
if ( wpnid == CSW_GLOCK18 )
{
set_pev(id, pev_viewmodel2, "models/shmod/five0_v_glock18.mdl")
}
}
public client_PreThink(id)
{
if(HasFive0[id] && is_user_alive(id))
{
entity_set_vector(id,EV_VEC_punchangle,gPunchAngle);
}
}
public weapon_change(id)
{
if ( !shModActive() || !HasFive0[id] )
return
new wpnid = read_data(2)
if ( wpnid == CSW_MP5NAVY )
return
if ( wpnid == CSW_GLOCK18 )
return
switch_model(id)
new clip = read_data(3)
if ( clip == 0 )
shReloadAmmo(id)
}
public five0_weapons(id)
{
if ( !shModActive() || !is_user_alive(id) || !HasFive0[id] )
return
shGiveWeapon(id, "weapon_mp5navy")
shGiveWeapon(id, "weapon_glock18")
}
public new_spawn(id)
{
if ( shModActive() && is_user_alive(id) && HasFive0[id] )
{
set_task(0.1, "five0_weapons", id)
}
}
public Event_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( HasFive0[attacker] && weapon == CSW_MP5NAVY && is_user_alive(id) )
{
new damage = read_data(2)
new headshot = bodypart == 1 ? 1 : 0
new extraDamage = floatround(damage * get_cvar_float("five0_mp5mult") - damage);
if (extraDamage > 0)
shExtraDamage( id, attacker, extraDamage, "mp5navy", headshot );
}
if ( HasFive0[attacker] && weapon == CSW_GLOCK18 && is_user_alive(id) )
{
new damage = read_data(2)
new headshot = bodypart == 1 ? 1 : 0
new extraDamage = floatround(damage * get_cvar_float("five0_glockmult") - damage);
if (extraDamage > 0)
shExtraDamage( id, attacker, extraDamage, "glock18", headshot );
}
}
__________________
|
|