var active_weapon_id = 0;
var active_weapon = 0;
var weapons[2];
//Switches the active weapon
function switch_active_weapon(var weapon_id)
{
weapons[active_weapon] = weapon_id;
}
//Used to cycle the Weapons
function weapon_changer_startup()
{
while(1)
{
active_weapon = cycle(active_weapon + mickey.z / 120,0,2); //Change Weapon with mousewheel
active_weapon_id = weapons[active_weapon];
wait(1);
}
}
// Use to shoot
function shoot()
{
switch(active_weapon_id)
{
case 0:
//Weapon with first ID
break;
case 1:
//Weapon with second ID
break;
case n:
//Weapon with n ID
break;
default:
//No Weapon or Weapon not defined
break;
}
}