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

2 Models in One Hero


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 04-26-2006 , 14:19   2 Models in One Hero
Reply With Quote #1

I would like to know if it is able to put 2 weapon models, by example: an ak47 and a deagle in one hero? If yes plz, tell me how or plz post a code for it, if u know no hero, take as example eehmm.. Madness.. not that I want to put 2 models in that one.
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)

Last edited by Xel0z; 06-16-2008 at 07:13.
Xel0z is offline
Send a message via MSN to Xel0z
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 04-26-2006 , 16:52  
Reply With Quote #2

Yeah, I think u can, but im not sure how... :/
DoXe is offline
boomheadshot
BANNED
Join Date: Apr 2006
Old 04-26-2006 , 17:47   what do u mean
Reply With Quote #3

what do u mean ak47 and deagle in one ? impossible
boomheadshot is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-26-2006 , 18:28  
Reply With Quote #4

dont post if you dont have anything good to say.

yes it is possible, look at heros for examples (terminatrix i think it is, well the female terminator, there was a hero made of that), check in the trash cause that might be where a lot of them are.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
D o o m
Veteran Member
Join Date: Sep 2005
Location: Germany
Old 04-27-2006 , 02:12  
Reply With Quote #5

Quote:
Originally Posted by Emp`
dont post if you dont have anything good to say.

yes it is possible, look at heros for examples (terminatrix i think it is, well the female terminator, there was a hero made of that), check in the trash cause that might be where a lot of them are.
Sorry Emp`, but Terminatrix isn't in the trash And it doesn't use anymore models It's just a non-modeled hero No player and no gunmodels

But I made that hero first with a model for every gun and that was a stupid idea But so I can give you the code...
Code:
public switchmodel(id)
{
	if ( !is_user_alive(id) || !gHasHeroPower[id] ) return
	new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
	if (wpnid == CSW_AK47) {
		// Weapon Model change thanks to [CCC]Taz-Devil
		Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/heroname_ak47.mdl")
	}
	else 	if (wpnid == CSW_DEAGLE) {
		// Weapon Model change thanks to [CCC]Taz-Devil
		Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/heroname_deagle.mdl")
	}
}
That's the switchmodel part

And don't forget to precache the model ;)
__________________
Heroes
:+: Deadpool :+:
D o o m is offline
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 04-27-2006 , 12:52  
Reply With Quote #6

ok, thx for helping and is it possible to get exploding bullets for both in one hero?
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)

Last edited by Xel0z; 06-16-2008 at 07:13.
Xel0z is offline
Send a message via MSN to Xel0z
D o o m
Veteran Member
Join Date: Sep 2005
Location: Germany
Old 04-27-2006 , 14:08  
Reply With Quote #7

I know that it is possible with 2 damage events, but maybe someone else can tell you an easier way for that
__________________
Heroes
:+: Deadpool :+:
D o o m is offline
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 04-27-2006 , 14:43  
Reply With Quote #8

why would u need 2 damage events.

just do exactly what u did for the model.

if ( wpn == wpn1 || wpn == wpn2 )
{
//explode bullet
}
__________________
yang is offline
Send a message via AIM to yang
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 04-28-2006 , 11:10  
Reply With Quote #9

This message is about the model adding again. I tried to add a m4a1 model into strike gundam, I put the model in public precache and wrote the switchmodel, but still the m4a1 stays normal. I even restarted the server, but it just wont work. So if someone can help me with this.. I would really appreciate it. I added this in the script:
Code:
precache_model("models/shmod/gundam_m4a1.mdl")
and

Code:
public switchmodel(id)
{
	if ( !is_user_alive(id) ) return

	new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
	if (wpnid == CSW_M4A1) {
		// Weapon Model change thanks to [CCC]Taz-Devil
		Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/gundam_m4a1.mdl")
	}
}
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)

Last edited by Xel0z; 06-16-2008 at 07:14.
Xel0z is offline
Send a message via MSN to Xel0z
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 04-28-2006 , 17:46  
Reply With Quote #10

Code:
//in plugins_init() //Gets called when you're using a weapon. register_event("CurWeapon", "changeWeapon", "be". "1=1") public changeWeapon(id) {     switchmodel(id) } public switchmodel(id) {    if ( !is_user_alive(id) ) return    new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)    if (wpnid == CSW_M4A1) {       // Weapon Model change thanks to [CCC]Taz-Devil       Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/gundam_m4a1.mdl")    } }

That should work. I'm guessing that you forgot to hook your function to an event so that it can be called.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag 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 00:04.


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