Jump to content
Sign in to follow this  
InqWiper

Need help with hint format

Recommended Posts

PlayerPos=getpos Player

Man=Player

Info=Pos

hint format [%1%2,Man,Info]

I thought this would hint the position of W1 but it seems like it doesnt.

hint format ["%1%2",Man,Info]

will hint "PlayerPos" but not the value of the variable PlayerPos.

If I could get this to work I could get my script like 1/100 the size it has to be otherwise. Does anyone understand what Im trying to do ?

Please help

confused.gif

Share this post


Link to post
Share on other sites

What does this do?

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["%1 %2", player, getPos player]<span id='postcolor'>

That should work. It doesn't?? Is the hint command being called by a client or by the server?

Doolittle

Share this post


Link to post
Share on other sites

Yes that works but its not what I want. It doesnt work with what Im trying to do.

MoneyW1=156

MoneyW2=123412

MoneyW3=23432489

MoneyW4=11237324

MoneyW5=132849

MoneyW6=1234

I want to be able to select a name from a list in a dialog and see the amount of money he has.

201 is a dropdown box

I use this:

_index = lbAdd [201, name W1]

lbSetData [201, _index, "W1"]

_index = lbAdd [201, name W2]

lbSetData [201, _index, "W2"]

_index = lbAdd [201, name W3]

lbSetData [201, _index, "W3"]

_index = lbAdd [201, name W4]

lbSetData [201, _index, "W4"]

_index = lbAdd [201, name W5]

lbSetData [201, _index, "W5"]

followed by

_PLAYERMONEY=lbData[201, lbCurSel 201]

PLAYERMONEY=format ["Money%1",_PLAYERMONEY]

ctrlsettext [202,format [{Money : %1}, PLAYERMONEY]]

202 is a text in the same dialog as the dropdownbox

I want it to show the money of the selected player. I want to use the format like the way that I tried cuz otherwise I have to do:

?lbData[201, lbCurSel 201]=="W1":ctrlsettext [202,format [{Money : %1}, MoneyW1]]

and then I have to do a string like that for every name. It would sure be easier with only those 3 lines than 48 lines. Thats why I would like to know if there is any way to get this to work.

This isnt the real problem, this is the simpler version. In the real version I have a list of like 5-10 variables that I want to check.

The way it is now it will say "Money : MoneyW1" when W1 is selected and "Money : MoneyW2" when W2 is selected.

The problem is I want it to say "Money : 156" and "Money : 123412"

I hope Im making any sense but its 02.40 here so its possible that Im not  smile.gif

Share this post


Link to post
Share on other sites

To make the script in your initial post work, you need to make it:

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

PlayerPos = getpos Player

Man = "Player"

Info = "Pos"

hint call format["%1%2",Man,Info]

<span id='postcolor'>

This will work as you want it I believe, although it will give you an error as the hint command requires a string, and the PlayerPos variable holds an array. This will work better:

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

PlayerPos = getpos Player

Man = "Player"

Info = "Pos"

hint format["%1",call format ["%1%2",Man,Info]]

<span id='postcolor'>

Share this post


Link to post
Share on other sites

Weeee!

It works!

Thanks alot smile.gif  smile.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  

×