Need help to locate the foult
1 Attachment(s)
I need someone to look this one though cant find the foult..
but i kinda need abit of help, so i seems that this code
Code:
// X P90 - Cool colt/p90.
/* CVARS - copy and paste to shconfig.cfg
//X P90
xpnty_level 10
xpnty_p90mult 1.5 //Multiplier for p90 damage
xpnty_gravity 0.40 //Gravity X P90 has
*/
#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>
// GLOBAL VARIABLES
new gHeroName[]="X P90"
new gHasXpntyPower[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO X P90", "1.1", "M0L")
register_cvar("xpnty_level", "38")
register_cvar("xpnty_p90mult", "4.5")
register_cvar("xpnty_gravity", "0.40")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "P90 Reskin", " Lower Gravity / New P90 skin with unlimited ammo and more damage", false, "xpnty_level")
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// Init
register_srvcmd("xpnty_init", "xpnty_init")
shRegHeroInit(gHeroName, "xpnty_init")
register_event("ResetHUD", "newSpawn", "b")
register_event("Damage", "xpnty_damage", "b")
register_event("CurWeapon", "weaponChange", "be", "1=1")
// Let Server know about US Marine's Variable
shSetMinGravity(gHeroName, "xpnty_gravity")
shSetShieldRestrict(gHeroName)
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/shmod/xpnty_p90.mdl")
}
//----------------------------------------------------------------------------------------------
public xpnty_init()
{
// First Argument is an id
new temp[6]
read_argv(1,temp,5)
new id = str_to_num(temp)
// 2nd Argument is 0 or 1 depending on whether the id has the hero
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
gHasXpntyPower[id] = (hasPowers != 0)
//Reset thier shield restrict status
//Shield restrict
shResetShield(id)
if ( !is_user_alive(id) ) return
if ( gHasXpntyPower[id] ) {
xpnty_weapons(id)
switchmodel(id)
}
else {
engclient_cmd(id, "drop", "weapon_p90")
shRemGravityPower(id)
}
}
//-----------------------------------------------------------------------------------------------
public newSpawn(id)
{
if ( gHasXpntyPower[id] && is_user_alive(id) && shModActive() ) {
set_task(0.1, "xpnty_weapons", id)
new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
if ( wpnid != CSW_P90 && wpnid > 0 ) {
new wpn[32]
get_weaponname(wpnid, wpn, 31)
engclient_cmd(id, wpn)
}
}
}
//-----------------------------------------------------------------------------------------------
public xpnty_weapons(id)
{
if ( is_user_alive(id) && shModActive() ) {
shGiveWeapon(id, "weapon_p90")
}
}
//-----------------------------------------------------------------------------------------------
public switchmodel(id)
{
if ( !is_user_alive(id) || !gHasXpntyPower[id] ) return
new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
if ( wpnid == CSW_P90 ) {
// Weapon Model change
Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/xpnty_p90.mdl")
}
}
//----------------------------------------------------------------------------------------------
public weaponChange(id)
{
if ( !gHasXpntyPower[id] || !shModActive() ) return
new wpnid = read_data(2)
new clip = read_data(3)
if ( wpnid != CSW_P90 ) return
switchmodel(id)
// Never Run Out of Ammo!
if ( clip == 0 ) {
shReloadAmmo(id)
}
}
//-----------------------------------------------------------------------------------------------
public xpnty_damage(id)
{
if ( !shModActive() || !is_user_alive(id) ) return
new damage = read_data(2)
new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
new headshot = bodypart == 1 ? 1 : 0
if ( attacker <= 0 || attacker > SH_MAXSLOTS ) return
if ( gHasXpntyPower[attacker] && weapon == CSW_P90 && is_user_alive(id) ) {
// do extra damage
new extraDamage = floatround(damage * get_cvar_float("xpnty_p90mult") - damage)
if (extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "p90", headshot)
}
}
//-----------------------------------------------------------------------------------------------
is not what it seems like, kinda not sure why. i hope someone will look into this one, and help me out.
|