Raised This Month: $32 Target: $400
 8% 

Displaying the '%' symbol


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 08-12-2016 , 12:05   Displaying the '%' symbol
Reply With Quote #1

How do I display the "%" symbol without it assuming I want to reference a variable?

I've tried both
Code:
PrintHintText(client, "100%%");
And
Code:
PrintHintText(client, "100%s", "%");
But none of these things worked properly.
stickz is offline
Michael Shoe Maker
Senior Member
Join Date: Apr 2016
Old 08-12-2016 , 12:09   Re: Displaying the '%' symbol
Reply With Quote #2

Quote:
Originally Posted by stickz View Post
How do I display the "%" symbol without it assuming I want to reference a variable?

I've tried both
Code:
PrintHintText(client, "100%%");
And
Code:
PrintHintText(client, "100%s", "%");
But none of these things worked properly.
"%%" should work.
Michael Shoe Maker is offline
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 08-12-2016 , 12:10   Re: Displaying the '%' symbol
Reply With Quote #3

Quote:
Originally Posted by Michael Shoe Maker View Post
"%%" should work.
It doesn't though.
stickz is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 08-12-2016 , 12:32   Re: Displaying the '%' symbol
Reply With Quote #4

I had an experience with this. When a string containing "%%" gets copied (either with strcopy or Format) over a few times, it outputs a weird behavior with PrintHintText.
There is a workaround to this by using other unicode symbols.

Try these:﹪(small) or % (full width).
dilalmon is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-12-2016 , 13:00   Re: Displaying the '%' symbol
Reply With Quote #5

"%%" will send one percent to the server as part of the hint text, but the server may be doing further processing. On some games if you print things like "%use%" in hint text, it gets replaced with the user's actual key bind.
Fyren is offline
Phil25
AlliedModders Donor
Join Date: Feb 2015
Old 08-12-2016 , 16:39   Re: Displaying the '%' symbol
Reply With Quote #6

It's been answered before. Put 3 % symbols.
Phil25 is offline
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 08-12-2016 , 17:04   Re: Displaying the '%' symbol
Reply With Quote #7

Quote:
Originally Posted by dilalmon View Post
There is a workaround to this by using other unicode symbols.
Try these:﹪(small) or % (full width).
Thanks, % works nicely in hint-text!
stickz is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 08-12-2016 , 17:06   Re: Displaying the '%' symbol
Reply With Quote #8

Hint text is displayed in HTML, to print % in hint text it's
PHP Code:
# 3 7 ; 
(remove spaces, keeps changing to %) %
__________________

Last edited by Deathknife; 08-12-2016 at 17:09.
Deathknife is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-15-2016 , 11:08   Re: Displaying the '%' symbol
Reply With Quote #9

Quote:
Originally Posted by Deathknife View Post
Hint text is displayed in HTML
That is only relevant to CS:GO.
psychonic is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode