Jump to content
Sign in to follow this  
ggxjimmy

need help dudes! players team score (kill points)

Recommended Posts

im stuck guys!

i've looked everywhere, wiki, here. but i cant find the code that lets you display the teams (east and Wests) kill scores ....you when you press "i" in multiplayer is displays team scores at the bottom (the total number of kills for west and east).

well i want that code so i can display these kills numbers in a hint box.. simple...but not so sad_o.gif

all help is much appreciated smile_o.gif

P.S ....i tried ScoreE and scoreW it just displays "0" all the time no matter what the score, im thinking this is flag scpre not kill score?!? correct?

Share this post


Link to post
Share on other sites

Try this to do. Need to make a system of triggers which would add 1 point the flag capture and kills.Below you can see:

Trigger 1:

Axis a: 0

Axis b: 0

Set to Repeatedly

Text: FlagscoreW

Condition: (ownerE in list FlagSwitchW) and not WflagTaken

On Activation: Flagcarrier=ownerE; ownerE=objNull; FlagE setFlagOwner objNull; WScore = WScore + 1; titletext[format ["One point for NATO\nScore : NATO %1 - Soviet %2", WScore, EScore],"Plain down"]; EFlagTaken=false; "_x addScore 5" forEach units group Flagcarrier

Effects: Sounds: Anonymous: WScore

Trigger 2:

Axis a: 0

Axis b: 0

Set to Repeatedly

Text: FlagscoreE

Condition: (ownerW in list FlagSwitchE) and not EflagTaken

On Activation: Flagcarrier=ownerW; ownerW=objNull; FlagW setFlagOwner objNull; EScore = EScore + 1; titletext[format ["One point for Soviet\nScore : NATO %1 - Soviet %2", WScore, EScore], "Plain down"]; WFlagTaken=false; "_x addScore 5" forEach units group Flagcarrier

Effects: Sounds: Anonymous: EScore

Trigger 3:

Axis a: 0

Axis b: 0

Activation: Radio Alpha

Set to Repeatedly

Text: Score

Condition: this

On Activation: titletext[format ["Score : NATO %1 - Soviet %2", WScore, EScore], "Plain down"]

P.S. All this need to be edit, well tried in OFP

Share this post


Link to post
Share on other sites

Just added this to a mission I'm making.....rough but works.

my init.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">PlayerArray = [GW1,GW1_1,GW1_2,GW1_3,GW1_4,GW1_5];

[]execVM "DisScore.sqf";

DisScore.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_list = [];

{_list = _list + [format["%1 %2\n" ,name _x,score _x]];}foreach PlayerArray;

hint format["%1",_list];

it will only show score's at start of game so you'll need to add a loop to update it.......I hope you have done your "hello world" scripts, your last 2 questions where vague.

I'm sure someone can come up with a better way.

Share this post


Link to post
Share on other sites

what are the hello world scripts?

im a newb with this scripting malarky!!!!

btw your script squ33z3 shows all the players score, not the total scores for east and west? is this correct?

if so how would i adapt it to add east and west scores together to get a total?

banghead.gif

to clarify, what i want to create in my multiplayer TDM is a hint box that appears every 120 seconds that shows the teams (east and west) total scores. so if player west_1 and west_2 both have 2 kills each the total west score would be 4.

Share this post


Link to post
Share on other sites

hope this is what your after.....

make a trigger to cover all players at start

Activation: Anybody

On Act: n=[thislist]execVM"DisScore.sqf"

DisScore.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_units = _this select 0;

if(not local player)exitwith{};

_wScore = 0;

_eScore = 0;

_wLoopScore = 0;

_eLoopScore = 0;

_Wunits = [];

_Eunits = [];

{

if(isplayer _x)then{ //sort players from AI and Sides

if(side _x == west)then{_Wunits = _Wunits + [_x]};

if(side _x == east)then{_Eunits = _Eunits + [_x]};

};

}foreach _units;

hint format["West Total = %1\nEast Total = %2",_wScore,_eScore];

while{(_wLoopScore < 5) and (_eLoopScore < 5)}do

{

{_wScore = _wScore + (score _x)}foreach _Wunits;

{_eScore = _eScore + (score _x)}foreach _Eunits;

_wLoopScore = _wScore;

_eLoopScore = _eScore;

sleep 10;

hint format["West Total = %1\nEast Total = %2",_wScore,_eScore];

_wScore = 0;

_eScore = 0;

};

if (true) exitWith {};

Share this post


Link to post
Share on other sites

thanks for your help squ33z3, its much appreciated! smile_o.gif

but im having trouble with the grammer of the code!?!?!

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_units = _this select 0;

if(not local player)exitwith{};

_wScore = 0;

_eScore = 0;

_wLoopScore = 0;

_eLoopScore = 0;

_Wunits = [];

_Eunits = [];

#Start

{

if(isplayer _x)then{};

if(side _x == west)then{_Wunits = _Wunits + [_x]};

if(side _x == east)then{_Eunits = _Eunits + [_x]};

};

foreach _units{};

hint format["West Total = %1\nEast Total = %2",_wScore,_eScore];

while{(_wLoopScore < 5) and (_eLoopScore < 5)}do

{

{_wScore = _wScore + (score _x)}foreach _Wunits;

{_eScore = _eScore + (score _x)}foreach _Eunits;

_wLoopScore = _wScore;

_eLoopScore = _eScore;

~10

hint format["West Total = %1\nEast Total = %2",_wScore,_eScore];

_wScore = 0;

_eScore = 0;

};

if (true) exitWith {};

Goto "Start"

can you see anything obvious?

thanks smile_o.gif

Share this post


Link to post
Share on other sites
can you see anything obvious?

yer.... crazy_o.gif what was wrong with the way I wrote it.

I'm speechless banghead.gif

Share this post


Link to post
Share on other sites

LOOOOL

it still came up with some errors from your original.

i'm testing it online on the GGX server. the map the code is on is TDM Tequila Sundown 2vs2

so i started changing the code around a bit  tounge2.gif  crazy_o.gif

Share this post


Link to post
Share on other sites

If you want to do it simple, do this:

In init box of every soldier: this addEventHandler ["killed",{_this exec "killed.sqs"}]

killed.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_victim = _this select 0

?(side _victim == WEST):scoreE=scoreE+1;publicvariable "scoreE"

?(side _victim == EAST):scoreW=scoreW+1;publicvariable "scoreW"

exit

If someone knows how to make it shorter... by all means!

Share this post


Link to post
Share on other sites
Quote[/b] ]it will only show score's at start of game so you'll need to add a loop to update it.......I hope you have done your "hello world" scripts, your last 2 questions where vague.

I'm sure someone can come up with a better way

couldn't you just exec the script on a trigger and make it repeatable..say like every 20sec?? Iam not a good scripter but thought id throw my two cents in...

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  

×