Here is my version of Karrilions CTF script(You can take the flag from a dead flag runner and score with it)I havent added the Show message.sqs, or the timer.sqs, just the part you are having problems with.
Simply delete the old ctf.sqs and replace it with this one
ctf.sqs;;CTF.sqs (this is the heart of the scoring and such)
;;CTF script by KaRRiLLioN
;;Modified by terox with dead flag runner fix
;;This selects the flag's name
_flag = _this select 0
?(isnull _flag):goto "end"
?(_flag==FlagW):_flag SetFlagSide WEST
?(_flag==FlagE):_flag SetFlagSide EAST
FlagW setflagtexture "usa_vlajka.pac"
FlagE setflagtexture "\flags\vietnam.jpg"
?(_flag==FlagW):_flagname="the GI Joes Flag"
?(_flag==FlagE):_flagname="the NVA's Flag"
_flag setFlagOwner objNull
goto "start"
#DeadHasFlag
_count = 1
?(isnull Flagowner FlagW) and _flagownerside==WEST:titletext[format["Hail the fallen HERO\n%1\n %2 is lying on his blood soaked corpse\n You have 60 seconds to retrieve it",name _flagowner,_flagname],"PLAIN DOWN"]
?(isnull Flagowner FlagE) and _flagownerside==EAST:titletext[format["Hail the fallen HERO\n%1\n %2 is lying on his blood soaked corpse\n You have 60 seconds to retrieve it",name _flagowner,_flagname],"PLAIN DOWN"]
#deadloop
~1
_count = _count + 1
_flagowner=Flagowner _flag
?(Alive _Flagowner):goto "start"
?(_count == 60):goto "flagreturn"
goto "deadloop"
#start
~1
_flagowner=Flagowner _flag
?(isnull _flagowner):Goto "start"
?(Side _flagowner==WEST):_team="GI Joes"; _flagownerside=WEST
?(Side _flagowner==EAST):_team="NVA"; _flagownerside=EAST
?!(Alive _flagowner):Goto "DeadHasFlag"
#FlagTaken
titletext[format["That awesome Warrior dude\n%1\n has taken %2!",name _flagowner,_flagname],"PLAIN DOWN"]
PlaySound "FlagTake"
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<4:goto "WCaps"
?(isnull Flagowner FlagE) and _flagownerside==EAST and _flagowner distance FlagE<4:goto "ECaps"
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
?Side Player == West:titletext[format["Awesome Warrior\n%1\n has capped\n %2!",name _flagowner,_flagname],"PLAIN DOWN"]
?Side Player == East:titletext[format["Thay dirty stinking scumbag\n%1\n has capped\n our flag",name _flagowner],"PLAIN DOWN"]
?(local Server):WScore=WScore+5; PublicVariable "WScore"
PlaySound "Capture"
Goto "ShowScore"
#ECaps
?Side Player == East:titletext[format["Awesome Warrior\n%1\n has capped\n %2!",name _flagowner,_flagname],"PLAIN DOWN"]
?Side Player == West:titletext[format["Thay dirty stinking scumbag\n%1\n has capped\n our flag",name _flagowner],"PLAIN DOWN"]
?(local Server):EScore=EScore+5; PublicVariable "EScore"
PlaySound "Capture"
Goto "ShowScore"
#ShowScore
?(local Server):ShowScore=true; PublicVariable "ShowScore"
Goto "FlagReturn"
#FlagReturn
?(_flag==FlagW):_flag SetFlagSide WEST
?(_flag==FlagE):_flag SetFlagSide EAST
_flag setFlagOwner objNull
_flagreturnmsg=format["%1 \n has been returned",_flagname]
Hint _flagreturnmsg
Goto "start"
#end
Exit
This works fine
You will have to excuse the Vietnam flag, i copied this from a nam mission i am making
There is one slight error which i havent fixed yet (Just havent had time)
Sometimes when the following line is run
"titletext[format["Hail the fallen HERO\n%1\n %2 is lying on his blood soaked corpse\n You have 60 seconds to retrieve it",name _flagowner,_flagname],"PLAIN DOWN"]"Instead of saying
"Hail the fallen hero
(Players Name)
the west flag is lying on his blood soaked corpse
You have 60 seconds to retrieve it"
It comes up with an error message where the players name should be
"Hail the fallen hero
(Error message here instead of players name)
the west flag is lying on his blood soaked corpse
You have 60 seconds to retrieve it"
However it doesnt stop the script from running and it only occasionally occurs
It simply just doesnt return the players name
The script is set up for a 60 second delay before the flag is returned