This would work:
Code: Select all
Script 1 (void) {
If(CheckWeapon("Shotgun")) {
action;
}
Else {
If(CheckWeapon("PlasmaRifle")) {
action;
}
Else {
If(CheckWeapon("RocketLauncher")) {
action;
}
}
}
}
One thing to remember about IF and ELSE statements.
If you have a script like this.
Code: Select all
Script 1 (void) {
If(cat1 == 1) {
action;
}
If(cat2 == 1) {
action;
}
If(cat3 == 1) {
action;
}
}
If cat1 = 1, cat2 = 1, and cat3 = 1, it will do all actions for cat1, cat2, and cat3.
If cat1 = 0, cat2 = 1, and cat3 = 1, it will do all actions for cat2 and cat3.
If cat1 = 0, cat2 = 0, and cat3 = 1, it will do all actions for cat3.
If you have a script like this.
Code: Select all
Script 1 (void) {
If(cat1 == 1) {
action;
}
Else {
If(cat2 == 1) {
action;
}
Else {
If(cat3 == 1) {
action;
}
}
}
}
If cat1 = 1, cat2 = 1, and cat3 = 1, it will only do the action for cat1.
If cat1 = 0, cat2 = 1, and cat3 = 1, it will only do the action for cat2.
If cat1 = 0, cat2 = 0, and cat3 = 1, it will only do the action for cat3.
Why? Because it reads straight down the list. If you are using ELSE statements, if the IF statement is True it will ignore anything in the ELSE statement.