Let's assume you have 3 flags. At the start of the game, flag 1 belongs to West, flag 2 belongs to noone, and flag 3 belongs to East. The second flag is set to be owned by resistance so that the other sides can take it. I'm not sure if you'll have to set resistance friendly to none in your mission setup for it to work 100%.
In your "init.sqs" (or "init" trigger), put the following:
score_west = 0; score_east = 0;
Create three flags: Flag1, Flag2, and Flag3.
In the "init" string for Flag1 put: this setFlagTexture "usa_vlajka.pac"; this setFlagSide west
In the "init" string for Flag2 put: this setFlagTexture "white.pac"; this setFlagSide resistance
In the "init" string for Flag3 put: this setFlagTexture "rus_vlajka.pac"; this setFlagSide east
Create three triggers to detect the capture of a flag:
Trigger 1:
Size: 0 by 0
Activate: Repeatedly
Activated by: None
Condition: flagOwner Flag1 != objNull
Activation: [Flag1] exec "flagswitch.sqs";
Trigger 2:
Size: 0 by 0
Activate: Repeatedly
Activated by: None
Condition: flagOwner Flag2 != objNull
Activation: [Flag2] exec "flagswitch.sqs";
Trigger 3:
Size: 0 by 0
Activate: Repeatedly
Activated by: None
Condition: flagOwner Flag3 != objNull
Activation: [Flag3] exec "flagswitch.sqs";
Create the script "flagswitch.sqs":
; Begin script
_flag = _this select 0
_side = side flagOwner _flag
; Change the flag's side.
_flag setFlagSide _side
; Change the flag's texture and award a point. Show a message as well.
?(_side == west) : _flag setFlagTexture "usa_vlajka.pac"; score_west = score_west + 1; titleText [ format[ "%1 captured a flag for west!\nWest: %2 - East: %3", name flagOwner _flag, score_west, score_east], "PLAIN DOWN"];
?(_side == east) : _flag setFlagTexture "rus_vlajka.pac"; score_east = score_east + 1; titleText [ format[ "%1 captured a flag for east!\nWest: %2 - East: %3", name flagOwner _flag, score_west, score_east], "PLAIN DOWN"];
; Set the owner to noone - its side has changed.
_flag setFlagOwner objNull
; End script.
Happy scripting
Pope Zog