Home   Help Search Login Register  

Author Topic: take flag won't show  (Read 1556 times)

0 Members and 1 Guest are viewing this topic.

DarkCell

  • Guest
take flag won't show
« on: 06 Nov 2003, 20:27:24 »
Hey people! :)

I made a Capture and Hold the flag map it means:
West and East have to capture flags and Hold them as long as they can...but okay. now the problem  :o

Everytime East or West wanna take a Flag the command "TAKE FLAG" wil be showed.
But when East wanna take the Flag West captures no Command shows up  ???
So when East captured a flag or West then the opposite Team cant take it back so the game can never be won :(

HERE IS HOW MY CaptureFlag.sqs script looks like:

_flag = _this select 0
_player = flagOwner _flag
?(_flag == Flag1): _msg = "Flag 1"
?(_flag == Flag2): _msg = "Flag 2"

_player addscore 5

goto format ["%1", side _player]
goto "end"

#West
WestFlag = WestFlag + [_flag]
EastFlag = EastFlag - [_flag]
PublicVariable "WestFlag"
PublicVariable "EastFlag"
~0.5
(flagOwner _flag) setflagowner _flag
_flag setflagowner _flag
~0.5
_flag setflagtexture "usa_vlajka.pac"
_flag setflagside West
?(_flag == Flag1): "mFlag1" setMarkerColor "ColorBLUE"
?(_flag == Flag2): "mFlag2" setMarkerColor "ColorBLUE"
titletext [format["NATO forces capture %1", _msg], "PLAIN DOWN"]
goto "end"

#East
EastFlag = EastFlag + [_flag]
WestFlag = WestFlag - [_flag]
PublicVariable "WestFlag"
PublicVariable "EastFlag"
~0.5
(flagOwner _flag) setflagowner _flag
_flag setflagowner _flag
~0.5
_flag setflagtexture "rus_vlajka.pac"
_flag setflagside East
?(_flag == Flag1): "mFlag1" setMarkerColor "ColorRED"
?(_flag == Flag2): "mFlag2" setMarkerColor "ColorRED"
titletext [format["Russian forces capture %1", _msg], "PLAIN DOWN"]
goto "end"

#end
[_flag, side _player] exec "control.sqs"
Exit



Can someone Tell me if there's a problem with it?
THNX for the person who can help me MANY THANX!  ;D
Greetz DarkCell  :)

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re:take flag won't show
« Reply #1 on: 07 Nov 2003, 00:26:38 »
You are doing publicVariable on a variable that is an array?  You can't do that.

Doolittle

DarkCell

  • Guest
Re:take flag won't show
« Reply #2 on: 07 Nov 2003, 23:22:25 »
So What do I have to change to it? How does my script has to look like? ???

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:take flag won't show
« Reply #3 on: 10 Nov 2003, 01:19:36 »

PublicVariable "WestFlag"
PublicVariable "EastFlag"


west & east flags are arrays, download tacticians c&h tutorial
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

DarkCell

  • Guest
Re:take flag won't show
« Reply #4 on: 10 Nov 2003, 16:13:46 »
THNX Terox you are realy a helpfull guy  :)
But I still got 1 problem...how can I add flags to this script?
I don't see anything about Flag1 flag2 and flag3
So plz tell me where in this script and what do I have to type in this script to add more flags?
DAMN! I am noob sometimes  :P
Thnx for the person who can solve my Last problem with this map :)

HERE IS HOW THE SCRIPT LOOKS LIKE NOW:

_flag = _this select 0
_side = _this select 1

?(_side == WEST): goto "West"
?(_side == EAST): goto "East"
exit

#West
?!(local Server): goto "Westclient"
WestScore = WestScore + 1
WestArray = WestArray + [_flag]
EastArray = EastArray - [_flag]
PublicVariable "WestScore"
#Westclient
(flagOwner _flag) setflagowner objNull
_flag setflagowner objNull
~0.2
_flag setflagtexture "usa_vlajka.pac"
_flag setflagside WEST
goto "end"

#East
?!(local Server): goto "Eastclient"
EastScore = EastScore + 1
EastArray = EastArray + [_flag]
WestArray = WestArray - [_flag]
PublicVariable "EastScore"
#Eastclient
(flagOwner _flag) setflagowner objNull
_flag setflagowner objNull
~0.2
_flag setflagtexture "rus_vlajka.pac"
_flag setflagside EAST
goto "end"

#end
?(local Server): [_flag, _side] exec "control.sqs"
~1.5
hint format["West: %1\nEast: %2", WestScore, EastScore]
Exit

DarkCell

  • Guest
Re:take flag won't show
« Reply #5 on: 10 Nov 2003, 17:55:30 »
ok problem is fixed this case is closed!  ;)

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:take flag won't show
« Reply #6 on: 10 Nov 2003, 17:55:54 »
_flag =_this select 0 is the key,  

this means that what actually executes the script is the flag, probably in its init field or in the init.sqs

eg
[Flag1] exec "cnh.sqs"

to add a flag create a new pole and call it flag4, flag5 etc etc

and then in the init.sqs add an additional line

[Flag4] exec "cnh.sqs"
[Flag5] exec "cnh.sqs"

where cnh.sqs is the name of the script
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123