No problems mate
The link you gave me is what i went from...
http://www.ofpec.com/forum/index.php?topic=25591.0Although i did what you just said you wanted to do, by testing in Mp with 2 ArmA's running...
Last night it worked for some reason but now its not im stuck
This is how ive set my scoring system up... Although i cant see where my problems lie's
do i need to make anymore triggers? or add anymore code?
Init.sqstx_Wkills = 0
tx_Ekills = 0
tx_W1score = 0
tx_E1score = 0
TimeEnd=0
tx_kill = player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
playerkilled.sqs_victim = _this select 0
_killer = _this select 1
_side = side _killer
player removeEventhandler ["killed",tx_kill]
if(side _victim == _side)then{hint "teamkill occurred";exit}
goto (format ["%1", _side])
#EAST
if (name _killer == name E1)then {tx_E1score = tx_E1score + 1;tx_Ekills = tx_Ekills + 1; {Publicvariable _x}foreach ["tx_E1score","tx_Ekills"]}
goto "END"
#WEST
if (name _killer == name W1)then {tx_W1score = tx_W1score + 1;tx_Wkills = tx_Wkills + 1; {Publicvariable _x}foreach ["tx_W1score","tx_Wkills"]}
goto "END"
#END
@alive player
tx_kill = player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
Outro.sqs_Winner = 0
_message = ""
if(tx_Wkills > tx_Ekills)then{_winner = 1}else{_winner = 2}
if(tx_Wkills == tx_Ekills)then{_winner = 0}
?(_winner == 0): goto "DRAW"
?(_winner == 1): goto "WWins"
?(_winner == 2): goto "EWins"
#DRAW
~7
TrueEnd=true
exit
#WWins
hint formaT [ "___ FINAL OUTCOME ___\n\n%1",_message]
_W1 = format ["\n%1 had %2 kills",name W1,tx_W1score]
_E1 = format ["\n%1 had %2 kills",name E1,tx_E1score]
hint formaT [ "___ INDIVIDUAL SCORES ___\n%1%2%3%4",_W1,_E1]
~7
TrueEnd=true
exit
#EWins
hint formaT [ "___ FINAL OUTCOME ___\n\n%1",_message]
_W1 = format ["\n%1 had %2 kills",name W1,tx_W1score]
_E1 = format ["\n%1 had %2 kills",name E1,tx_E1score]
hint formaT [ "___ INDIVIDUAL SCORES ___\n%1%2%3%4",_W1,_E1]
~7
TrueEnd=true
exit
Description.exttitleParam1 = "Time:";
valuesParam1[] = {10000, 300, 600, 900, 1200, 1500, 1800, 2700, 3600, 7200};
defValueParam1 = 1800;
textsParam1[] = {"Unlimited", "5 min", "10 min", "15 min", "20 min", "25 min", "30 min", "45 min", "1 hour", "2 hours"};
titleParam2 = "Score to win:";
valuesParam2[] = {10000, 5, 7, 10, 15, 20, 25, 30};
defValueParam2 = 5;
textsParam2[] = {"Unlimited", 5, 7, 10, 15, 20, 25, 30};
You also need to create some triggers for your map
first one is called Scorelimit which when the score that is set at the start of the mission is reached then this is called and ends the DM
In the condition filed you put
(param1<10000 and ((time >= param1) or (TimeEnd >= param1))) or (param2<10000 and ((tx_W1score >=param2) or (tx_E1score >=param2)))
the on activation you put
TimeEnd=time; publicVariable "TimeEnd"; player exec "Outro.sqs"
The next trigger is named End
Type is End1
in the condition field you put
TrueEnd
and in the on activation field you put
ForceEnd
Any ideas?
Btw does it make a difference if i have blank lines in the init.sqs? or should i put
; in the blank lines?