Raised This Month: $ Target: $400
 0% 

player model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 05-02-2006 , 14:27   player model
Reply With Quote #1

I would like to add a player model into my hero, I tryed much and added this ( +the whole other effects of the hero ):
Code:
new gmorphed[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------	
{
	// NEW ROUND
	register_event("ResetHUD","newSpawn","b") //Called on a New Spawn
	//Death of Player
	register_event("DeathMsg", "jetstream_death", "a")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
	precache_model("models/player/JetStream/sh_jetstream.mdl")
}
//----------------------------------------------------------------------------------------------
jetstream_init()
{	
	if ( hasPowers ) //Check if person selected this hero
	{
		jetstream_tasks(id)
	}
	if ( !hasPowers  && is_user_connected(id) ) //Check if person dropped this hero
	{
		//Do stuff to him if he just droppped it
		jetstream_unmorph(id)
	}
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
	if ( gHasjetstreamPower[id] && is_user_alive(id) && shModActive() ) 
	{
		jetstream_tasks(id)
	}
	return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public jetstream_tasks(id)
{
	set_task(1.0, "jetstream_morph", id)
}
//----------------------------------------------------------------------------------------------
public jetstream_morph(id)
{
	if ( gmorphed[id] || !is_user_alive(id) ) return

	#if defined AMXX_VERSION
	cs_set_user_model(id, "sh_jetstream")
	#else
	CS_SetModel(id, "sh_jetstream")
	#endif

	// Message
	set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
	show_hudmessage(id, "You now wear your JetStream armor.")

	gmorphed[id] = true
}
//----------------------------------------------------------------------------------------------
public jetstream_unmorph(id)
{
	if ( gmorphed[id] ) {
		// Message
		set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
		show_hudmessage(id, "You are not wearing your JetStream armor.")

		#if defined AMXX_VERSION
		cs_reset_user_model(id)
		#else
		CS_ClearModel(id)
		#endif

		gmorphed[id] = false
	}
}
//----------------------------------------------------------------------------------------------
public jetstream_death()
{
	new id = read_data(2)
	jetstream_unmorph(id)
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
	gmorphed[id] = false
}
//----------------------------------------------------------------------------------------------
But still it just doesnt work.. Can someone help me or put the code for add a player model?
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)

Last edited by Xel0z; 06-16-2008 at 07:12.
Xel0z is offline
Send a message via MSN to Xel0z
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 05-02-2006 , 15:03  
Reply With Quote #2

Code:
   #if defined AMXX_VERSION 
   cs_set_user_model(id, "sh_jetstream") 
   #else 
   CS_SetModel(id, "sh_jetstream") 
   #endif
Try JetStream instead of sh_jetstream.

cs_set_user_model doesn't use the filename, but the folder that contains the file name, i.e. JetStream rather than sh_jetstream.mdl.

models/player/JetStream/sh_jetstream.mdl Whatever is inside the bolded text is what you would use in cs_set_user_model and CS_SetModel.
__________________
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
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 05-02-2006 , 15:05  
Reply With Quote #3

owk I try
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)
Xel0z is offline
Send a message via MSN to Xel0z
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 05-02-2006 , 18:53  
Reply With Quote #4

the model has to be named the same as the folder it is in
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 05-03-2006 , 05:13  
Reply With Quote #5

Never knew that, thought it would just take any folder name. Thanks for the info.
__________________
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
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 05-03-2006 , 07:49  
Reply With Quote #6

Ah like that, it works, ty guys
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)
Xel0z is offline
Send a message via MSN to Xel0z
infernal2
Member
Join Date: May 2006
Old 05-03-2006 , 09:32  
Reply With Quote #7

I hawe the same interest as that guy
Hey i dont get it i like checked the code a bit and other heros so what do i hawe 2 do 2 add a hero weapons skins and weapons sounds (stock sounds, just change 4 a singls hero wepon sound 2 another)
__________________
[img]ftp://84.237.128.247/Infernal.jpg[/img]
infernal2 is offline
Send a message via MSN to infernal2
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:49.


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