in the sma have i change the mdl and name but i don't know the codes for the sound so plz can some one add the sound code or just tell me the code so u dan do the rest by my self
Code:
// Wayne
/* CVARS - copy and paste to shconfig.cfg
//Wayne Gretzky
Wayne_level 0
Wayne_healpoints 3 //The # of HP healed per second
Wayne_knifespeed 290 //Speed of Wayne Gretzky in knife mode
Wayne_knifemult 1.35 //Multiplier for knife damage
*/
#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>
// GLOBAL VARIABLES
new gHeroName[]="Wayne"
new bool:ghasWaynePowers[SH_MAXSLOTS+1]
new gPlayerMaxHealth[SH_MAXSLOTS+1]
new gHealPoints
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Wayne Gretzky","1.17.5","dawe")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("Wayne_level", "0" )
register_cvar("Wayne_healpoints", "3" )
register_cvar("Wayne_knifespeed", "290")
register_cvar("Wayne_knifemult", "1.35" )
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Auto-Heal & Claws", "Auto-Heal, Extra Knife Damage and Speed Boost", false, "Wayne_level" )
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
register_srvcmd("Wayne_init", "Wayne_init")
shRegHeroInit(gHeroName, "Wayne_init")
// HEAL LOOP
set_task(1.0,"Wayne_loop",0,"",0,"b" )
// EXTRA KNIFE DAMAGE
register_event("Damage", "Wayne_damage", "b", "2!0")
// Kinfe Model
register_event("ResetHUD", "newSpawn","b")
register_event("CurWeapon", "weaponChange","be","1=1")
// Let Server know about Woverines max knife speed
shSetMaxSpeed(gHeroName, "Wayne_knifespeed", "[29]" )
//Makes superhero tell wolverine a players max health
register_srvcmd("Wayne_maxhealth", "Wayne_maxhealth")
shRegMaxHealth(gHeroName, "Wayne_maxhealth" )
gHealPoints = get_cvar_num("Wayne_healpoints")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/shmod/Wayne_knife.mdl")
}
//----------------------------------------------------------------------------------------------
public Wayne_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 wolverine skills
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
gPlayerMaxHealth[id] = 100
ghasWaynePowers[id] = (hasPowers!=0)
switchmodel(id)
// Got to slow down a Wayne that lost his powers...
if ( !ghasWaynePowers[id] && is_user_connected(id) ) {
shRemSpeedPower(id)
}
}
//----------------------------------------------------------------------------------------------
public Wayne_loop()
{
if (!shModActive()) return
for ( new id = 1; id <= SH_MAXSLOTS; id++ ) {
if ( ghasWaynePowers[id] && is_user_alive(id) ) {
// Let the server add the hps back since the # of max hps is controlled by it
// I.E. Superman has more than 100 hps etc.
shAddHPs(id, gHealPoints, gPlayerMaxHealth[id] )
}
}
}
//----------------------------------------------------------------------------------------------
public Wayne_damage(id)
{
if (!shModActive() || !is_user_alive(id)) return PLUGIN_CONTINUE
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 PLUGIN_CONTINUE
if ( ghasWaynePowers[attacker] && weapon == CSW_KNIFE && is_user_alive(id) ) {
// do extra damage
new extraDamage = floatround(damage * get_cvar_float("Wayne_knifemult") - damage)
if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "knife", headshot )
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public Wayne_maxhealth()
{
new id[6]
new health[9]
read_argv(1,id,5)
read_argv(2,health,8)
gPlayerMaxHealth[str_to_num(id)] = str_to_num(health)
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
if ( ghasWaynePowers[id] && is_user_alive(id) && shModActive() ) {
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid != CSW_KNIFE && wpnid > 0) {
new wpn[32]
get_weaponname(wpnid,wpn,31)
engclient_cmd(id,wpn)
}
}
}
//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
if ( !is_user_alive(id) || !ghasWaynePowers[id] ) return
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid == CSW_KNIFE) {
// Weapon Model change thanks to [CCC]Taz-Devil
Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/Wayne_knife.mdl")
}
}
//----------------------------------------------------------------------------------------------
public weaponChange(id)
{
if ( !ghasWaynePowers[id] || !shModActive() ) return
//new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
new wpnid = read_data(2)
if ( wpnid == CSW_KNIFE ) switchmodel(id)
}
//----------------------------------------------------------------------------------------------