Raised This Month: $ Target: $400
 0% 

How to attach bomb model to CT's back ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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