-SoF-Max 0 Posted December 22, 2006 I thought I had this set right but it just sits on a dead players body. East and West <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">expCond="HasflagW AND !(alive flagownerWflag)"; expActiv="EastFlagRun=false; Wflag setFlagOwner objNull; HasflagW=false; titletext[""The SLA flag was returned"",""Plain down""]"; class Effects <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">expCond="HasflagE AND !(alive flagownerEflag)"; expActiv="WestFlagRun=false; Eflag setFlagOwner objNull; HasflagE=false; titletext[""The US flag was returned"",""Plain down""]"; class Effects Any suggestions? Share this post Link to post Share on other sites
-SoF-Max 0 Posted December 26, 2006 Max @ Dec. 22 2006,07:52)]I thought I had this set right but it just sits on a dead players body. East and West<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">expCond="HasflagW AND !(alive flagownerWflag)"; expActiv="EastFlagRun=false; Wflag setFlagOwner objNull; HasflagW=false; titletext[""The SLA flag was returned"",""Plain down""]"; class Effects <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">expCond="HasflagE AND !(alive flagownerEflag)"; expActiv="WestFlagRun=false; Eflag setFlagOwner objNull; HasflagE=false; titletext[""The US flag was returned"",""Plain down""]"; class Effects Any suggestions? Anyone? Share this post Link to post Share on other sites
-DirTyDeeDs--Ziggy- 0 Posted December 26, 2006 well I have the will to help , I just lack the knowledge I have opened up an OFP map and looked at a CTF script made by Karrilion, which has flag return included. Perhaps what you seek is in the script. I hope this helps. Of course, the names for my flag images will be different than yours... Quote[/b] ];;CTF script by KaRRiLLioN ;;This selects the flag's name ;;Exec this from init.sqs like so: ;;[FlagW]exec "CTF.sqs" ;;do this for each flag _flag = _this select 0 ?(isnull _flag):goto "end" ;;The following simply sets the textures on the flags and can be ;;changed to whatever you want. You could actually ;;remove the ?(_flag==FlagW) and instead just put in ;;FlagW SetFlagTexture "\Flags\Nato.jpg and do the same ;;for each one. ?(_flag==FlagW):_flag setflagtexture "\Flags\Nato.jpg" ?(_flag==FlagE):_flag setflagtexture "\Flags\Ussr.jpg" ?(_flag==FlagR):_flag setflagtexture "\Flags\Pirates.jpg" ;;This just creates a name for when the flag is taken or ;;capped or dropped. ?(_flag==FlagW):_flagname="the NATO Flag" ?(_flag==FlagE):_flagname="the Soviet Flag" ?(_flag==FlagR):_flagname="the Resistance Flag" ;;This inits the flagside for each flag. ?(_flag==FlagW):_flag SetFlagSide WEST ?(_flag==FlagE):_flag SetFlagSide EAST ?(_flag==FlagR):_flag SetFlagSide RESISTANCE ;;this sets the flag owner to nobody _flag setFlagOwner objNull #start ~1 _flagowner=Flagowner _flag ?(isnull _flagowner):Goto "start" ?(Side _flagowner==WEST):_team="NATO"; _flagownerside=WEST ?(Side _flagowner==EAST):_team="Soviets"; _flagownerside=EAST ?(Side _flagowner==RESISTANCE):_team="Resistance"; _flagownerside=RESISTANCE ?!(Alive _flagowner):Goto "DeadHasFlag" #FlagTaken #DelayLoop ~1 _delay=_delay-1 ?(!Alive _flagowner):goto "DeadHasFlag" ?(_delay>0):Goto "DelayLoop" Goto "loop" ;;the loop continues to check for whether the flagcarrier is ;;dead, or has capped the flag. Once either happens, the ;;flag is returned #loop ~1 ?(!Alive _flagowner):goto "DeadHasFlag" ?(isnull Flagowner FlagW) and _flagownerside==WEST and _flagowner distance FlagW<5:goto "WCaps" ?(isnull Flagowner FlagE) and _flagownerside==EAST and _flagowner distance FlagE<5:goto "ECaps" ?(isnull Flagowner FlagR) and _flagownerside==RESISTANCE and _flagowner distance FlagR<5:goto "RCaps" Goto "loop" ;;this increments the score by 1 point for whichever team ;;caps the flag. You can change the +1 to +5 or whatever ;;you want for a scoring method. The ?(local Server) ;;makes sure the score is only incremented by the server ;;so that it remains accurate. #WCaps Goto "ShowScore" #ECaps Goto "ShowScore" #RCaps Goto "ShowScore" #ShowScore ?(local Server):ShowScore=true; PublicVariable "ShowScore" Goto "FlagReturn" ;;if flagcarrier dies, this resets the flag immediately to the ;;flagpole. You can delay this by any time you want by ;;adding a value in seconds just before where it says ;;goto "FlagReturn" #DeadHasFlag ;;~60 If you remove the ;; then the ~60 will delay the flag ;;returning to the flagpole by 60 seconds. I leave this off ;;because sometimes someone will try to cap a flag that ;;is on a body and not get there before 60 seconds and the ;;flag disappears on them. #FlagReturn ?(_flag==FlagW):_flag SetFlagSide WEST ?(_flag==FlagE):_flag SetFlagSide EAST ?(_flag==FlagR):_flag SetFlagSide RESISTANCE _flag setFlagOwner objNull Hint _flagreturnmsg Goto "start" #end Exit ;;;;END of CTF.SQS Share this post Link to post Share on other sites
KaRRiLLioN 0 Posted December 26, 2006 Ah, reminds me of the original OFP days of working out BIS's CTF with bloody triggers. Gah! That script Ziggy posted will work, but it's an old version of my CTF script. I've discovered a few bugs that happen with JIP so I'm gonna rejigger my script to account for those anomolies. I also have a newer version with dynamic variables. That script will still work. Just place your flags on the map and follow the instructions in the comments of the script. Share this post Link to post Share on other sites