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

Weapon Models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 04-06-2008 , 19:32   Weapon Models
Reply With Quote #1

any one know the best way to set weapon models? i see some methods that were tried before , but i dont see anything successfull .
Peoples Army is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 04-07-2008 , 06:29   Re: Weapon Models
Reply With Quote #2

Set w_* model with function SetEntiyModel() (sdktools_functions.inc)
Set v_* model with offset "m_nViewModelIndex"; m_nViewModelIndex it's a integer
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
TheDOO
Member
Join Date: Nov 2007
Old 04-07-2008 , 17:56   Re: Weapon Models
Reply With Quote #3

Quote:
Originally Posted by SAMURAI16 View Post
Set w_* model with function SetEntiyModel() (sdktools_functions.inc)
Set v_* model with offset "m_nViewModelIndex"; m_nViewModelIndex it's a integer
Can you show an example of this?
TheDOO is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 04-07-2008 , 18:03   Re: Weapon Models
Reply With Quote #4

Code:
 
 
SetEntityModel(entity,"w_whatever.mdl");
 
 
new Handle:ModelOffset = -1;
new String:Model[32];
 
ModelOffset = FindSendPropOffs("CHEGrenade","m_nViewModelIndex");
 
 
if(ModelOffset != -1)
{
           SetEntDataString(entity,ModelOffset,Model,31);
}
The "CHEGreande is the base for the he nade , you might want somethign else

Last edited by Peoples Army; 04-07-2008 at 18:15.
Peoples Army is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 04-07-2008 , 18:34   Re: Weapon Models
Reply With Quote #5

Does this actually work?

I know when I changed view models a couple years ago they wouldn't work because of model consistency checking stuff going on.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 04-07-2008 , 18:39   Re: Weapon Models
Reply With Quote #6

well if player models can be changed , weapon models can be also . i havent tested this code yet , but it makes sence theoreticly . but also a year ago there was no SDK kit realeased yet so sourcemod was missing 90 percent of its functionality .

i think server consitancy is based on :

sv_consitency 1
Peoples Army is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 04-07-2008 , 19:01   Re: Weapon Models
Reply With Quote #7

This was in a MMS plugin, before SM had been announced (or at least on the first major version that was completely re-written).

I just tried again and I don't get errors in the console (maybe I need to be in developer mode in listenserver?) but the world model and view model don't change when I set every weapon (immediately after it is spawned) to the mp5's model.

I did get a weird thing with the viewmodel remaining as my lowest slot weapon no matter which weapon I changed to, or if I dropped a weapon.

EDIT: Also
SetEntDataString(entity,ModelOffset,Model,31);
won't work because model index is a number returned when the model is cached. You can retrieve the index number from the engine though to set already cached models like weapon view models.
__________________
"Good grammar is essential, Robin."
- Batman

Last edited by L. Duke; 04-07-2008 at 19:04.
L. Duke is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 04-07-2008 , 20:22   Re: Weapon Models
Reply With Quote #8

wat im wondering about is , since theres no event for weapon change specificly , how to set the models so they stay , without using a infiante loop or timer
Peoples Army is offline
noob cannon lol
SourceMod Donor
Join Date: Sep 2005
Old 04-07-2008 , 20:23   Re: Weapon Models
Reply With Quote #9

I remember that overriding the the model returned in CBaseCombatWeapon::GetViewModel() did the trick since Valve decided to set the viewmodel every time the weapon was equipped or there was an animation played.

That's just a solution in a server plugin, I'm not sure if there's a way to do it in sourcemod
noob cannon lol is offline
Send a message via AIM to noob cannon lol Send a message via MSN to noob cannon lol
V0gelz
Senior Member
Join Date: Jun 2004
Old 04-08-2008 , 04:45   Re: Weapon Models
Reply With Quote #10

Like i posted in my thread. I was also wondering how to do this. And founded those functions but i had no clue getting them to work.
__________________
V0gelz 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 10:07.


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