I think your code switches weapons very fast:
everytime the loop runs, and you still have the q key pressed, the weapons will switch again and again.
function switch_weapons()
{
v_selected_wpn += 1;
v_selected_wpn %= 2;
if (v_selected_wpn == 1)
{
STRING* str_selected_number = "2";
}
if (v_selected_wpn == 0)
{
STRING* str_selected_number = "1";
}
}
and then somewhere else:
this makes your code run only once, when you press the q button