I have adopted my c&h script to accomodate your King of the hill mission
ok first thing to do is create a trigger of ellipse type that encompasses the area that you want to class as the Hill
The way the system is basically going to work is to count how many east or west players are within the trigger area. If only 1 side are present then we will change the flag texture to that side, change an area marker colour and add a score.
Also when the hill is captured the players on the side of the team that has captured will hear an alarm sound, if they are in the trigger area
The score will continue to add for that side until they are not present and the opposing forces are
so first things first
1) Create a trigger
Set both axis to whatever size you want, and set it to ANYBODY and REPEATING
name the trigger "atFlag1"
condition: this
2) Place a flagpole on the hill at name the flagpole "Flag1"
3) Create a marker, either of icon type or an ellipse marker. If its an icon, use flag and place it right where the flag is, if you are going to use an ellipse marker then its size and location needs to be the3 same as the trigger, set its colour so that at the start it isnt blue or red, (green or black will do). Name the marker "Hillmarker"
then in the init.sqs type the following line
[] exec "checkhill.sqs"
@ time>1
then create the following script
;;checkhill.sqs
;;captime is the amount of time in seconds that only 1 side has to be on the hill to allow capping of the flag, change this value as you please
captime=5
;;Flagcap is the value you want to give in points everytime the hill changes hands
Flagcap=3
Flag1stat = 0
WScore = 0
EScore = 0
~0.25
?(isnull Flag1):goto "end"
Flag1 setflagtexture "flag.jpg"
#START
~1
?(EAST countside list AtFlag1 == 0 ) && (WEST countside list AtFlag1 > 0 ):Goto "WSTART"
?(WEST countside list AtFlag1 == 0 ) && (EAST countside list AtFlag1 > 0 ):Goto "ESTART"
Goto "START"
#WSTART
_Wloop = Captime
#WCHECKLOOP
~1
?(WEST countside list AtFlag1 == 0) OR (EAST countside list AtFlag1 > 0):goto "START"
?(WEST countside list AtFlag1 > 0) && (EAST countside list AtFlag1== 0):_Wloop = _Wloop - 1
?(_Wloop <= 0):[] exec "Score.sqs"; goto "WCAPS"
goto "WCHECKLOOP"
#ESTART
_Eloop = Captime
#ECHECKLOOP
~1
?(EAST countside list AtFlag1 == 0) OR (WEST countside list AtFlag1 > 0):goto "START"
?(EAST countside list AtFlag1 > 0) && (WEST countside list AtFlag1 == 0):_Eloop = _Eloop - 1
?(_Eloop <= 0):[] exec "score.sqs"; goto "ECAPS"
goto "ECHECKLOOP"
;;;;;;;;;;;;;;;;;;;;;;;;; __________ WEST FLAG SYSTEM __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
#WCAPS
?(Time>=Param1):exit
?!(local Server):goto "W_ALL"
#WSERVER
WScore=WScore+Flagcap; PublicVariable "WScore"
Flag1stat = 1; PublicVariable "Flag1stat"
#W_ALL
Flag1 setflagtexture "usa_vlajka.pac"
"Hillmarker" setMarkerColor "ColorBLUE"
?(Side player == WEST && Player in list AtFlag1):playsound "alarm"
~0.5
?Side Player == WEST:titletext[format["We have taken the hill"],"PLAIN DOWN"]
?Side Player == EAST:titletext[format["The enemy has the hill"],"PLAIN DOWN"]
#WLOOPSTART
_Wcount = Captime
#WESTLOOP
~1
?(WEST countside list AtFlag1 > 0) OR (EAST countside list AtFlag1 == 0):goto "WLOOPSTART"
?(WEST countside list AtFlag1 == 0) && (EAST countside list AtFlag1 > 0):_Wcount = _Wcount -1
?(_WCount <= 0):goto "ECAPS"
goto "WESTLOOP"
;;;;;;;;;;;;;;;;;;;;;;;;; __________ end of west flag __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; __________ EAST FLAG SYSTEM __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
#ECAPS
?(Time>=Param1):exit
?!(local Server):goto "E_ALL"
#ESERVER
EScore=EScore+Flagcap; PublicVariable "EScore"
Flag1stat = 2; PublicVariable "Flag1stat"
#E_ALL
Flag1 setflagtexture "rus_vlajka.pac"
"Hillmarker" setMarkerColor "ColorRED"
?(Side player == EAST && Player in list AtFlag1):playsound "alarm"
~0.5
?Side Player == EAST:titletext[format["We have the Hill"],"PLAIN DOWN"]
?Side Player == WEST:titletext[format["The enemy has the Hill"],"PLAIN DOWN"]
#ELOOPSTART
_Ecount = Captime
#EASTLOOP
~1
?(EAST countside list AtFlag1 > 0) OR (WEST countside list AtFlag1 == 0):goto "ELOOPSTART"
?(EAST countside list AtFlag1 == 0) && (WEST countside list AtFlag1 > 0):_Ecount = _Ecount -1
?(_ECount <= 0):goto "WCAPS"
goto "EASTLOOP"
;;;;;;;;;;;;;;;;;;;;;;;;; __________ end of east flag __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
#END
hint "Debug: Flag 1 doesn't exist, exiting checkhill.sqs"
exit
________________________________________________________________________
Then you will need a scoring script
;;;score.sqs, this is started up by the checkhill.sqs
?!(local Server):exit
#START
~1
?(Flag1stat == 0):goto "START"
?(Flag1stat == 1):goto "WEST"
?(Flag1stat == 2):goto "EAST"
;;;;;;;;;;;;;;;;;;;;;;;;; __________ WEST FLAG SCORE __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
#WEST
_westcount = 0
_westcycle = 0.5
#WESTLOOP
?(Flag1stat != 1):goto "START"
~1
_westcount = _westcount + 1
~0.5
?(Time>=Param1):exit
?(_westcount == 30):WScore=WScore + _westcycle; PublicVariable "WScore"
~0.5
?(_westcount == 30):_westcount = 0; _westcycle = _westcycle + 0.5
?(Time>=Param1):exit
goto "WESTLOOP"
;;;;;;;;;;;;;;;;;;;;;;;;; __________ end of west flag __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; __________ EAST FLAG SYSTEM __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
#EAST
_eastcount = 0
_eastcycle = 0.5
#EASTLOOP
?(Flag1stat != 2):goto "START"
~1
_eastcount = _eastcount + 1
~0.5
?(Time>=Param1):exit
?(_eastcount == 30):EScore=EScore + _eastcycle; PublicVariable "EScore"
~0.5
?(_eastcount == 30):_eastcount = 0; _eastcycle = _eastcycle + 0.5
?(Time>=Param1):exit
goto "EASTLOOP"
;;;;;;;;;;;;;;;;;;;;;;;;; __________ end of east flag __________ ;;;;;;;;;;;;;;;;;;;;;;;;;
--------------------------------------------------------------------------------------------------------------------
You now have a fully working king of the hill script, untested but it should work.
You will however have to do some work yourself.
You will need to figure out how to show the score to everybody, this is fairly simple, but if i do everything for you, you wont learn a thing
My suggestion is to use a hint box and also to create a radio trigger so that at will anybody can call the score to show as well as automatically done in the scripting system
Oh 1 more thing, you will need to create a jpg file for your neutral flag texture, call this file flag.jpg and place it in your mission folder