Using SM 1.3 its really easy.
PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 3 && weapon > 0)
{
new melee = GetPlayerWeaponSlot(client, 2);
if (melee > -1 && weapon != melee)
{
weapon = melee;
}
}
}