Jump to content
Sign in to follow this  
ramboofp

Color change bugupdatef

Recommended Posts

color of the flag of my CH dont change correctly on all client !

how can i fix that?

and how can i avoid that a east soldier see "West force control the Flag #"

capture.sqs

Quote[/b] ]; Based on Backoff's Capture and Hold tutorial

;Based on Tactician's Capture and Hold tutorial

_flag = _this select 0

_player = _this select 1

?(side _player == west): goto "West"

?(side _player == east): goto "East"

exit

#West

?((flag1stat == 1)and(_flag == flag1)): exit

?((flag2stat == 1)and(_flag == flag2)): exit

?((flag3stat == 1)and(_flag == flag3)): exit

?((flag4stat == 1)and(_flag == flag4)): exit

?((flag5stat == 1)and(_flag == flag5)): exit

?!(local Server): goto "Westclient"

?(_flag == flag1): flag1stat = 1

PublicVariable "flag1stat"

?(_flag == flag2): flag2stat = 1

PublicVariable "flag2stat"

?(_flag == flag3): flag3stat = 1

PublicVariable "flag3stat"

?(_flag == flag4): flag4stat = 1

PublicVariable "flag4stat"

?(_flag == flag5): flag5stat = 1

PublicVariable "flag5stat"

WestScore = WestScore + 1

WestArray = WestArray + [_flag]

EastArray = EastArray - [_flag]

PublicVariable "WestScore"

#Westclient

~0.2

_flag setflagtexture "usa_vlajka.pac"

?((_flag == flag1)and(side _player == west)):titletext["West force control the Flag 1","PLAIN DOWN"]

?((_flag == flag2)and(side _player == west)):titletext["West force control the Flag 2","PLAIN DOWN"]

?((_flag == flag3)and(side _player == west)):titletext["West force control the Flag 3","PLAIN DOWN"]

?((_flag == flag4)and(side _player == west)):titletext["West force control the Flag 4","PLAIN DOWN"]

?((_flag == flag5)and(side _player == west)):titletext["West force control the Flag 5","PLAIN DOWN"]

goto "end"

#East

?((flag1stat == 2)and(_flag == flag1)): exit

?((flag2stat == 2)and(_flag == flag2)): exit

?((flag3stat == 2)and(_flag == flag3)): exit

?((flag4stat == 2)and(_flag == flag4)): exit

?((flag5stat == 2)and(_flag == flag5)): exit

?!(local Server): goto "Eastclient"

EastScore = EastScore + 1

EastArray = EastArray + [_flag]

WestArray = WestArray - [_flag]

PublicVariable "EastScore"

?(_flag == flag1): flag1stat = 2

PublicVariable "flag1stat"

?(_flag == flag2): flag2stat = 2

PublicVariable "flag2stat"

?(_flag == flag3): flag3stat = 2

PublicVariable "flag3stat"

?(_flag == flag4): flag4stat = 2

PublicVariable "flag4stat"

?(_flag == flag5): flag5stat = 2

PublicVariable "flag5stat"

#Eastclient

~0.2

_flag setflagtexture "rus_vlajka.pac"

?((_flag == flag1)and(side _player == east)):titletext["East force control the Flag 1","PLAIN DOWN"]

?((_flag == flag2)and(side _player == east)):titletext["East force control the Flag 2","PLAIN DOWN"]

?((_flag == flag3)and(side _player == east)):titletext["East force control the Flag 3","PLAIN DOWN"]

?((_flag == flag4)and(side _player == east)):titletext["East force control the Flag 4","PLAIN DOWN"]

?((_flag == flag5)and(side _player == east)):titletext["East force control the Flag 5","PLAIN DOWN"]

goto "end"

#end

?(local Server): [_flag, _side] exec "control.sqs"

Exit

updateflag.sqs launched by init

Quote[/b] ]

~3

#loop

~.1

?(flag1stat = 2):"obj1" setmarkercolor "colorred"

~.1

?(flag2stat = 2):"obj2" setmarkercolor "colorred"

~.1

?(flag3stat = 2):"obj3" setmarkercolor "colorred"

~.1

?(flag4stat = 2):"obj4" setmarkercolor "colorred"

~.1

?(flag5stat = 2):"obj5" setmarkercolor "colorred"

~.1

?(flag1stat = 1):"obj1" setmarkercolor "colorgreen"

~.1

?(flag2stat = 1):"obj2" setmarkercolor "colorgreen"

~.1

?(flag3stat = 1):"obj3" setmarkercolor "colorgreen"

~.1

?(flag4stat = 1):"obj4" setmarkercolor "colorgreen"

~.1

?(flag5stat = 1):"obj5" setmarkercolor "colorgreen"

goto "loop"

Share this post


Link to post
Share on other sites

At the moment I don't know much about mp editing.

No idea why the flag doesnt change on all clients, but as always it's very likely to be a client/server scripting problem.

When I read the script, I think

?(side _player == west): goto "West"

?((_flag == flag1)and(side _player == west)):titletext["West force control the Flag 1","PLAIN DOWN"]

goto "end"

should avoid that the wrong side gets the capture information. And OFPEC lists titletext as local command in mp, so that won't be the problem.

There is a mistake in updateflag.sqs:

?(flag1stat <span style='color:red'>=</span>= 2):"obj1" setmarkercolor "colorred"

and so on...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×