Raised This Month: $32 Target: $400
 8% 

Using weapon and hat models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pTu
Senior Member
Join Date: Nov 2010
Location: Poland
Old 09-06-2013 , 13:28   Using weapon and hat models
Reply With Quote #1

Hello

How can I use in plugin weapon or hat models?

If i want use custom or prop model use my code:
PHP Code:
    #define MDL_GIFT "models/props_halloween/halloween_gift.mdl"
    
new ent CreateEntityByName("prop_physics_override");
    
SetEntityModel(ent,MDL_GIFT);
    
DispatchKeyValue(ent"StartDisabled""false");
    
DispatchSpawn(ent);
    
TeleportEntity(entg_posNULL_VECTORNULL_VECTOR);
    
//SetEntityMoveType(ent, MOVETYPE_NONE);
    //DispatchKeyValue(ent, "ExplodeRadius", "100");
    //DispatchKeyValue(ent, "ExplodeDamage", "300");
    //SetEntProp(ent, Prop_Data, "m_takedamage", 2);
    
AcceptEntityInput(ent"Disable"); 
I don't know how to use weapons or hat models from vpk.
pTu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-06-2013 , 13:53   Re: Using weapon and hat models
Reply With Quote #2

Well, for one you can't really create a weapon or hat directly... you need TF2Items for that. And Valve makes items you don't own invisible.

I've never tried changing the model on an existing weapon or hat/misc, though.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-06-2013 at 13:53.
Powerlord is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 09-06-2013 , 14:57   Re: Using weapon and hat models
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
I've never tried changing the model on an existing weapon or hat/misc, though.
SetEntityModel won't work and neither iModelIndex, Valve patched it about two years ago still (after Kemsan released it here).
__________________
napalm00 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-06-2013 , 15:36   Re: Using weapon and hat models
Reply With Quote #4

Quote:
Originally Posted by Powerlord View Post
Well, for one you can't really create a weapon or hat directly... you need TF2Items for that. And Valve makes items you don't own invisible.

I've never tried changing the model on an existing weapon or hat/misc, though.
This thread is solely about using the models independently (as the example code shows, with a standard prop_physics_override), creating items has nothing to do with it.
__________________
asherkin is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-06-2013 , 17:31   Re: Using weapon and hat models
Reply With Quote #5

iModelIndex does work, just not reliably.

Dont setentitymodel, dispatchkeyvalue model, and solid...
Also dispatchkeyvaluevector origin and angles, rather than teleportentity.

Disable input is not what you need..

You should do like... Activateentity, and mabye sent an inout to disable motion if you want the physprop to be stationary.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 12:21.


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