Here is another way of doing it. This will force use any entity.
This code will force use any entity the player is looking at, but you could simply supply any entity you wish.
PHP Code:
new entity, bodypart
// Get which entity is being looked at
get_user_aiming( id, entity, bodypart )
// Check if the entity is valid
if( is_valid_ent( entity ) )
{
// Force use the entity
force_use( entity, id )
}