Jump to content
Sign in to follow this  
nullsystems

Message Format of "player" problem...

Recommended Posts

Hi all,

I have just tried to use the hint and sidechat ( or groupchat etc ) format and assigning some variables with the players name....

_text=Format["%1 is my name %2 is my game",player, _something]

Player groupChat _text

However, the problem is %1 comes out as 'WEST 1-1-1A MyNickname' not just my nick, how do I get it to work without the WEST etc?

Also, will this method work as im wanting it to in multiplayer, for every person that activates this script, the name is different.

Share this post


Link to post
Share on other sites

This should do it:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_text=Format["%1 is my name %2 is my game",name player, _something]

Share this post


Link to post
Share on other sites

Thanks, excellent I thought so.

I do have another problem:

Im calling this from a script:

Quote[/b] ]_suspectbag = name player

[_suspectbag, bagbank] exec "Suspect\tracker.sqs"

tracker.sqs

-----------

Quote[/b] ]_player = _this select 0

_marker = _this select 1

hint format["Testing %1 and marker is %2",_player,_marker]

"_marker" setMarkerPos (getPos _player)

-----------

However this produces an error:

Quote[/b] ]Type string, expected object error at (|#|getPos _player)

And:

The hint format for testing comes out with the name ok, but the secondary %2 comes out as scalar bool error.

I presume it cannot getPos someone from the location of their multiplayer / game name?

But the other %2 is really confusing.

Share this post


Link to post
Share on other sites

its because.

_player = _this select 0 is the same as _suspectbag = name player.. meaning its a string. you cant get the position from a string. "the name of the player"

change _suspectbag = name player to just player and it should be alright

Share this post


Link to post
Share on other sites

Nice explanation thank you.

any thoughts on the reason why the _marker returns scalar errors?

Share this post


Link to post
Share on other sites

try replasing

"_marker" setMarkerPos (getPos _player)

with

format["%1",_marker] setMarkerPos (getPos _player)

and get rid you you hint line tounge2.gif

Share this post


Link to post
Share on other sites

Interesting setup, looks like it would work but it doesnt do anything.

No errors tho. Any other ideas?

_suspectbagbank = player

[_suspectbagbank,bagbankmarker] exec "Suspect\tracker.sqs"

tracker.sqs:

Quote[/b] ]_player = _this select 0

_marker = _this select 1

format["%1",_marker] setMarkerPos (getPos _player)

Share this post


Link to post
Share on other sites

if i got you right,, you are trying to track a player with a marker ?

in that case..

// suspect.sqf

_player = player;

_marker = "a name";

nil = [_player,_marker] execvm "track.sqf";

// track.sqf

_pl = _this select 0;

_name = _this select 1;

_marker = createMarker [format["%1",_name], getpos player];

while {(alive player)} do {

format["%1",_name] setMarkerPos (getpos player);

sleep 0.5;

};

i think this should work,, have not tested it out , cos im at work wink_o.gif

Share this post


Link to post
Share on other sites

lol I cant believe this, right as you posted I worked out I needed it in quotation marks...im a dumass.

I do like the idea of actually creating one on the fly, but ill keep testing. Thanks for your help and nice attitude ( for a change ) lol biggrin_o.gif

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  

×