Home   Help Search Login Register  

Author Topic: percent or %  (Read 771 times)

0 Members and 2 Guests are viewing this topic.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
percent or %
« on: 30 Nov 2002, 06:11:30 »
how do I use a percent sign within a hint? ofp seems to drop it from a hint message.

Hoz
Xbox Rocks

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:percent or %
« Reply #1 on: 30 Nov 2002, 06:51:36 »
At first I wasn't sure, but I figured out how just now.
:)

You first have to declare the percent sign as a string variable like this:

percentstring = "%"

Then you can do your formatted hint like this:

hint format["Hello, my name is %1, and I can put a %2 sign on the screen! Woohoo!",name player,percentstring]

I attached an example mission so you can see it.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re:percent or %
« Reply #2 on: 01 Dec 2002, 03:40:53 »
Thanks that worked.

Hoz
Xbox Rocks