I though there is one simple function that does what I want.
If anyone has the same problem, this code solves it
PHP Code:
const int Slot_Primary = 0; /** Primary weapon slot. */
const int Slot_Secondary = 1; /** Secondary weapon slot. */
.
.
.
int temp = GetPlayerWeaponSlot(id, Slot_Primary);
if( temp != -1 )
CS_DropWeapon(id, temp, false, true);