so this script should work then?
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <superheromod>
#define PLUGIN "Tony Montana"
#define VERSION "1.0"
#define AUTHOR "Vendetter"
// Hero
new gHeroName[] = "Tony Montana"
new bool:gHasTonyMontana[SH_MAXSLOTS+1]
// Recoil
new Float:gPunchAngle[3] = {0.0,0.0,0.0}
// Models
new g_v_model;
public plugin_init()
{
register_plugin("Tony Montana", "1.0", "Vendetter");
register_cvar("montana_level", "10");
register_cvar("montana_mult", "2.0");
shCreateHero(gHeroName, "M4A1 Power-Up", "Say Hello To My Little Friend", false, "montana_level");
register_srvcmd("montana_init", "montana_init");
shRegHeroInit(gHeroName, "montana_init");
register_event("CurWeapon", "weapon_change","be","1=1");
register_event("ResetHUD", "new_spawn","b");
register_event("Damage", "Event_damage","b");
}
public plugin_precache()
{
g_v_model = precache_model("models/shmod/sh_montana_m4a1.mdl");
}
public montana_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:
{
gHasTonyMontana[id] = true
if( is_user_alive(id) )
{
tonymontana_weapons(id)
switch_model(id)
}
}
case false:
{
if( is_user_alive(id) && gHasTonyMontana[id] )
{
engclient_cmd(id, "drop", "weapon_m4a1")
}
gHasTonyMontana[id] = false
}
}
}
switch_model(id)
{
if ( !shModActive() || !is_user_alive(id) || !gHasTonyMontana[id] )
return
new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
if ( wpnid == CSW_M4A1 )
{
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_v_model));
}
}
public Event_weapon(id)
{
new clip = read_data(3)
if (clip == 0)
{
shReloadAmmo(id)
}
}
public client_PreThink(id)
{
if(gHasTonyMontana[id] && is_user_alive(id))
{
entity_set_vector(id,EV_VEC_punchangle,gPunchAngle);
}
}
public weapon_change(id)
{
if ( !shModActive() || !gHasTonyMontana[id] )
return
new wpnid = read_data(2)
if ( wpnid != CSW_M4A1 )
return
switch_model(id)
new clip = read_data(3)
if ( clip == 0 )
shReloadAmmo(id)
}
public tonymontana_weapons(id)
{
if ( !shModActive() || !is_user_alive(id) || !gHasTonyMontana[id] )
return
shGiveWeapon(id, "weapon_m4a1")
}
public new_spawn(id)
{
if ( shModActive() && is_user_alive(id) && gHasTonyMontana[id] )
{
set_task(0.1, "tonymontana_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( gHasTonyMontana[attacker] && weapon == CSW_M4A1 && is_user_alive(id) )
{
new damage = read_data(2)
new headshot = bodypart == 1 ? 1 : 0
new extraDamage = floatround(damage * get_cvar_float("montana_mult") - damage);
if (extraDamage > 0)
shExtraDamage( id, attacker, extraDamage, "m4a1", headshot );
}
}
I don't have time to test it right this second but i think i changed what i needed to