Jump to content
Sign in to follow this  
pipo1nsano

Hmmmm help

Recommended Posts

how do i know where the %1 and %2 etc stands for in this code>

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleText[FORMAT["%1: %2 %3 %4", name _player, "wins"], "PLAIN"];<span id='postcolor'>

Share this post


Link to post
Share on other sites

example:

_first = "first"

_second = "second"

_third = "third"

_fourth = "fourth"

text = format ["%1 %2 %3 %4 %3 %2 %1",_first,_second,_third,_fourth]

hint text

will produce a box with the text:

first second third fourth third second first

hope that helps.

--fd

Share this post


Link to post
Share on other sites

so when i put this in a script and pipo activates it than there wil be a text > Pipo wins

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

?((!(_player in _list)&&!(vehicle _player in _list))||!alive Player): exit;

titleText[FORMAT["%1", name _player, "wins"], "PLAIN"];

exit;

<span id='postcolor'>

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (pipo1nsano @ Mar. 12 2003,09:45)</td></tr><tr><td id="QUOTE">so when i put this in a script and pipo activates it than there wil be a text > Pipo wins

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

  ?((!(_player in _list)&&!(vehicle _player in _list))||!alive Player): exit;

titleText[FORMAT["%1", name _player, "wins"], "PLAIN"];

exit;

<span id='postcolor'><span id='postcolor'>

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">titleText [format ["%1 wins", name _player], "PLAIN"];<span id='postcolor'>

Share this post


Link to post
Share on other sites

so when i put this script in a mission and it wil be activated by jan and piet is also in the mission jan and piet get the message jan wins?

greetz

pipo1nsano

Share this post


Link to post
Share on other sites

as long as all clients are running the same trigger the same way.

_player must be the same value on both machines. if so, then i'd say it will work.

--fd

Share this post


Link to post
Share on other sites

now ive got a problem with a script like thatone

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

_trigger = _this select 1;

_list = list _trigger;

?((!(_player in _list)&&!(vehicle _player in _list))||!alive Player): exit;

titleText[FORMAT["%1: %2 %3 %4", name _player, "wins THA RACE"], "PLAIN"];

exit;

<span id='postcolor'>

screenie

It worked with OFP 1.46

greetz

pipo1nsano

Share this post


Link to post
Share on other sites

It looks like problem with script calling. It shoud be something like :

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

[player,triggerName] exec "scriptName.sqs"

<span id='postcolor'>

and I think you doesn't understand format yet. Even your example works.

It shoud be :

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

titleText[FORMAT["%1: wins THA RACE", name _player], "PLAIN"]<span id='postcolor'>

In commas "  " is text that will be dislpayed. %1, %2 ... are substitutes that will be replaced by code after ""

%1 takes first thing after "" - that is name _player in your example.

And semi-colon ; is not needed at the end of each script line. Maybe it can be the problem.

Share this post


Link to post
Share on other sites

Ok it works now smile.gif

Code i use </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_player = _this select 0;

titleText[FORMAT["%1: wins THA RACE", name _player], "PLAIN"]

<span id='postcolor'>

greetz

pipo1nsano

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  

×