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