Jump to content
Sign in to follow this  
bloodxgusher

What do these stand for: %1,%2...%9 ?

Recommended Posts

Hello all.

Just looking for any information on what %1 or any number combined with the %.

I come across this in quite a bit of reference code and wondered what it is and its use. Here is some examples.


(format ["%1 switchmove ""%2"";", _civ, "amovppnemstpsnonwnondnon"]) call broadcast;
player groupchat "You released the civilian!";


(format ["%1 switchmove ""%2"";", _civ, "civillying01"]) call broadcast;

(format['server globalchat "%3 was restrained by %2";if (rolestring == "%1") then {execVM "Unrestrain.sqf";}', _civ, name player, name _civ]) call broadcast;



I have seen %1 - %5 used before. The only thing I know about this is that %1 has something do with or is equal to the player and %2 has to do with another player interacting with player.

Thanks.

Share this post


Link to post
Share on other sites

§21) Use descriptive thread titles

If you start a new thread, please make sure your thread title explains what you want without forcing people to read through your post first.

Thread titles such as "How in the world do I...", "Need help!" or "Will we ever see..." are anything but descriptive. We do not allow these kind of titles and threads with such titles are subject to be closed.

Thread title changed, please try to be more descriptive next time. ;)

As for your problem, those are placeholder/pointers:

_textA = "Sir";
_textB = "Yes";
hintsilent format ["%1 %2 %1", _textA, _textB];

This would spit out a hint with the following text:

Sir Yes Sir

The string is the text that is composed. The numbers with th e % are placeholders and point to the values after the string, %1 being "Sir" and %2 being "Yes". It doesn't need to be a string, also numerical values can be inserted, say a score or remaining lives.

Share this post


Link to post
Share on other sites
Myke;2233614']Thread title changed' date=' please try to be more descriptive next time. ;)

As for your problem, those are placeholder/pointers:

_textA = "Sir";
_textB = "Yes";
hintsilent format ["%1 %2 %1", _textA, _textB];

This would spit out a hint with the following text:

The string is the text that is composed. The numbers with th e % are placeholders and point to the values after the string, %1 being "Sir" and %2 being "Yes". It doesn't need to be a string, also numerical values can be inserted, say a score or remaining lives.[/quote']

Appreciate the info gentlemen. I will review.

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  

×