Raised This Month: $51 Target: $400
 12% 

Wayne Gretzky hero


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dawe
Member
Join Date: Jan 2006
Location: sweden
Old 02-11-2007 , 12:02   Wayne Gretzky hero
Reply With Quote #1

i have made a hero like Wayne Gretzky
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)
}
//----------------------------------------------------------------------------------------------
Attached Files
File Type: rar Wayne Gretzky.rar (181.5 KB, 150 views)
dawe is offline
Send a message via MSN to dawe
D o o m
Veteran Member
Join Date: Sep 2005
Location: Germany
Old 02-11-2007 , 14:12   Re: Wayne Gretzky hero
Reply With Quote #2

Well, the question is when should the sound be played?

And you can look at Master Chief how to include a sound..

It's something with emit_sound(a few codeparts here)
__________________
Heroes
:+: Deadpool :+:
D o o m is offline
dawe
Member
Join Date: Jan 2006
Location: sweden
Old 02-11-2007 , 15:46   Re: Wayne Gretzky hero
Reply With Quote #3

ok thanks
what i "shoot" it will be a other sound and when i hit a player or a wall and when i swing the "knife" in the air its many wav files i have post the wav files
dawe is offline
Send a message via MSN to dawe
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 02-15-2007 , 14:00   Re: Wayne Gretzky hero
Reply With Quote #4

Wayne Gretzky wouldn't even hit anyone in the nhl, why make him a killer with a hockey stick. Forget Wayne the Wolverine.

Just use this instead:
http://forums.alliedmods.net/showthr...325#post305325
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
shadi002
Junior Member
Join Date: Jun 2007
Old 06-22-2007 , 18:21   Re: Wayne Gretzky hero
Reply With Quote #5

Rip of wolverwrine?
shadi002 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode