Hi Ruben,
I divided the 'inv_get_floating_icon_item' function I gived you above into two different functions for better understanding and usage. It was a bit messy.

Code:
function inv_clear_floating_icon ()
{
	if ( inv_floating_flag )
	{
		inv_floating_flag = 0;
		global_floating_item_ptr->item = NULL;		
		bmap_remove(global_floating_item_ptr->floating_item_panel->bmap);
		pan_remove(global_floating_item_ptr->floating_item_panel);
	}
}

var inv_get_floating_icon_item_id ()
{
	if ( inv_floating_flag )
	{
		return global_floating_item_ptr->item->id; 
	}
	else
	{
		error ( "Not existent floating icon on 'inv_get_floating_icon_item_id'.\nValidate the existence of a floating icon before calling 'inv_get_floating_icon_item_id'." );
		return -1;
	}
}



So your 'item_was_dropped' funtion into my example could look as follows:
Code:
#define skill_id   skill20
...
action actObject ()
{
	...
}

function item_was_dropped ()
{
	if ( !mouse_panel ) // Is the mouse pointer out of a panel?
	{
		if ( inv_is_floating() ) // Does a floating icon exists?
		{
			if ( mouse_left ) // Is the mouse left button pressed?
			{
				var item_id = inv_get_floating_icon_item_id (); // Get the floating icon item id.
				inv_clear_floating_icon (); // Clear the floating icon.
				switch ( item_id ) // Create the new scenery object.
				{
					case SNIPERGUN: 
						ENTITY *entObject = ent_create ( "snipergun.mdl", player.x, actObject );
						entObject.skill_id = item_id;
						break;
					case SHOTGUN: 
						ENTITY *entObject = ent_create ( "shotgun.mdl", player.x, actObject );
						entObject.skill_id = item_id;
						break;
					case SHOTGUN: 
						ENTITY *entObject = ent_create ( "machinegun.mdl", player.x, actObject );
						entObject.skill_id = item_id;
						break;
				}
			}
		}
	}
}



Salud!