thats the shooter template so you should put the question in the right forum, however thats not the code that unnequip weapon its somewhere when use the var got_weapon, to answer your question I think that the best willi be an array as i told you before
lets see
var Weapon[100];//this create an array that is a group of 100 vars

you asign the value of each var according to the "state" of the weapon like
0 if it is not selected and not possesed
1 if it is selected
2 if it is not selected but possesed

Weapon[4] = 2;//this mean that you have the weapon number 4 but its not equiped

so with switch and if statements you can run the commands that you desire according to the "state" of the weapon

I also add that that piece of code is redundant you should just write t_shooter_weapon = 0;
because any result becomes into 0


CAUTION :The content above could blow your mind