Raised This Month: $ Target: $400
 0% 

How to attach bomb model to CT's back ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-24-2014 , 01:18   How to attach bomb model to CT's back ?
Reply With Quote #1

Attempt 1 : By default, the terrorist models have a submodel backpack which is the same as "models/w_backpack.mdl" ( bomb ) while the counter-terrorists, also have a submodel backpack which is the same as "models/w_thighpack.mdl" ( defusal kit )
I want counter terrorists to have "models/w_backpack.mdl" as backpack but that's not possible due to submodels ( entity is not unique/ not found )
I tried and it failed as usual :

Code:
	give_item ( <player_index>, "item_thighpack" );
	cs_set_user_submodel ( <player_index>, 1 );
	new submodel_ent = find_ent_by_class ( -1, "item_thighpack" );
	while ( submodel_ent > 0 )
	{
		entity_set_model ( submodel_ent, "models/w_backpack.mdl" );
		submodel_ent = find_ent_by_class ( -1, "item_thighpack" );
	}

Attempt 2 : By attaching a new entity to the player aiment but it's distorted and misplaced and need some maths with origin and angle which I can't figure out :

Code:
	new tempent = create_entity ( "info_target" );
	entity_set_model ( tempent, "models/w_backpack.mdl" );
	entity_set_int ( tempent, EV_INT_movetype, MOVETYPE_FOLLOW );
	entity_set_edict ( tempent, EV_ENT_aiment, <player_index> );
	entity_set_edict ( tempent, EV_ENT_owner, <player_index> );
Attempt 3 : Last I tried was using client_PreThink to stick it to player origin but again it need a lot of maths including player aim checking which again I can't figure out.

Code:
	new Float: origin[3];
	entity_get_vector ( id, EV_VEC_origin, origin );
	entity_set_origin ( tempent, origin );
Need some help with it. Can't find any suitable TUT related to it

Last edited by souvikdas95; 03-24-2014 at 07:03.
souvikdas95 is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 03-25-2014 , 05:35   Re: How to attach bomb model to CT's back ?
Reply With Quote #2

PHP Code:
entity_set_int(idEV_INT_body1); 
__________________
What are you looking for here?
DavidJr is offline
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-25-2014 , 05:58   Re: How to attach bomb model to CT's back ?
Reply With Quote #3

@DavidJr - Unfortunately the submodels are unique... for CTs - it's defusal kit... for T's - it's bomb. I wanted CTs to get the bomb ( the bag at the back of the player )

Last edited by souvikdas95; 03-25-2014 at 05:58.
souvikdas95 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-25-2014 , 06:49   Re: How to attach bomb model to CT's back ?
Reply With Quote #4

Quote:
Originally Posted by DavidJr View Post
PHP Code:
entity_set_int(idEV_INT_body1); 
Would be nice if you tested your code before posting it once in a while.

Quote:
Originally Posted by souvikdas95 View Post
@DavidJr - Unfortunately the submodels are unique... for CTs - it's defusal kit... for T's - it's bomb. I wanted CTs to get the bomb ( the bag at the back of the player )
Yes, it's actually part of the player model, so you would have to do it manually.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 06:03.


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