The following script is an edited version of the one i used for the EFL CTF Template
It's loosly based on a script that was available nearly 2 years ago but was bugged
It will need a bit of editing, I have only placed the script for the East flag, doesnt take a miracle worker to edit for West flag
doesnt require any triggers, simply call the flag EFlag and WFlag
and in your init.sqs start the two scripts with the following lines
[] exec "WFlag.sqs"
[] exec "EFlag.sqs"
in the script below when the offencive team take a flag, the defencice team arent informed. Simply uncomment the lines if you want the defenders to know
you will have to add your own sound effects, the sounds i used are called "Fanfare" and "Gong", simply replace these with the name of your own sound files
;;;;;;;; ________ DO NOT EDIT THIS SCRIPT ________ ;;;;;;;;
;;CTF Script for East's flag
;;Name East flag EFlag
?(isnull EFlag):hint "Object EFlag does not exist";goto "DeBug"
EFlag SetFlagSide East
EFlag setflagtexture "rus_vlajka.pac"
EFlag setFlagOwner objNull
goto "start"
#start
~0.5
EFlagrunner = FLAGOWNER EFlag
?(isnull EFlagrunner ):Goto "START"
?(Alive EFlagrunner ):Goto "FLAGTAKEN"
?!(Alive EFlagrunner ):Goto "DEADHASFLAG"
#FLAGTAKEN
?(Side Player==West):titletext[format["%1 has East's Flag!",name EFlagrunner],"PLAIN DOWN"];PlaySound "fanfare"
;;?(Side Player==East):titletext[format["Our Flag is missing"],"PLAIN DOWN"];PlaySound "fanfare"
Goto "LOOP"
#LOOP
~0.5
?!(Alive EFlagrunner):goto "DEADHASFLAG"
?(isnull Flagowner WFlag) and EFlagrunner distance WFlag<5:goto "WCaps"
Goto "LOOP"
#WCaps
?(Side Player == West):titletext[format["%1 capped a flag!",name EFlagrunner],"PLAIN DOWN"]
?(Side Player == East):titletext[format["The enemy has scored"],"PLAIN DOWN"]
PlaySound "gong"
?(local Server):WScore = WScore + ctf_Score; PublicVariable "WScore"
Goto "ShowScore"
#ShowScore
?(local Server):ShowScore=true; PublicVariable "ShowScore"
Goto "FLAGRETURN"
#FlagReturn
EFlag SetFlagSide East
hint format ["East's Flag \n has been returned"]
EFlag setFlagOwner objNull
Goto "start"
#DEADHASFLAG
_count = 1
?(!Alive EFlagrunner)&&(Side Player == West)&& !(player==EFlagrunner):titletext[format["Our Flagrunner is dead\nWe have %1 seconds to retrieve it",FLAGRETURNDELAY],"PLAIN DOWN"]
?!(Alive EFlagrunner)&&(Side Player == EAST):titletext[format["Enemy flagrunner is dead!"],"PLAIN DOWN"]
#deadloop
~0.5
_count = _count + 0.5
EFlagrunner = FLAGOWNER EFlag
?(Alive EFlagrunner ):goto "start"
?(_count == FLAGRETURNDELAY):goto "FLAGRETURN"
goto "DEADLOOP"
#Debug
~5
hint "Eflag_CTF script exiting"
goto "END"
#end
Exit