Raised This Month: $12 Target: $400
 3% 

Solved % char in menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 09-16-2018 , 10:39   % char in menu
Reply With Quote #1

I know It'll sound as a stupid question but How can i show the % character in a menu? I Tried escaping It with ^% or Just passing % directly and didn't work

menu_additem( hMenu, "test %", "", 0 );
menu_additem( hMenu, "test ^%", "", 0 );
__________________

Last edited by marcelowzd; 09-16-2018 at 12:54.
marcelowzd is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 09-16-2018 , 10:52   Re: % char in menu
Reply With Quote #2

will format/formatex change anything ?
JocAnis is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 09-16-2018 , 10:55   Re: % char in menu
Reply With Quote #3

Quote:
Originally Posted by JocAnis View Post
will format/formatex change anything ?
The menu i'm building actually uses formatex, so no
__________________
marcelowzd is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 09-16-2018 , 11:10   Re: % char in menu
Reply With Quote #4

Try: %%
__________________
My English is A0
E1_531G is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 09-16-2018 , 12:52   Re: % char in menu
Reply With Quote #5

Quote:
Originally Posted by E1_531G View Post
Try: %%
This is the answer, thanks.
__________________
marcelowzd is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-16-2018 , 16:11   Re: % char in menu
Reply With Quote #6

The code that you actually posted shouldn't have any issues because that function doesn't do any formatting. If it really is having that issue, it is a bug. If you are using a function that is actually formatting a string (e.g. format() or formatex()) then %% is the proper solution.

So, if "menu_additem( hMenu, "test %", "", 0 );" doesn't work, you need to report it as a bug.

If you are using format or formatex, you should update your original post to show that because as it stands this thread doesn't make any sense.
__________________

Last edited by fysiks; 09-16-2018 at 16:13.
fysiks is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-17-2018 , 03:54   Re: % char in menu
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
The code that you actually posted shouldn't have any issues because that function doesn't do any formatting. If it really is having that issue, it is a bug. If you are using a function that is actually formatting a string (e.g. format() or formatex()) then %% is the proper solution.

So, if "menu_additem( hMenu, "test %", "", 0 );" doesn't work, you need to report it as a bug.

If you are using format or formatex, you should update your original post to show that because as it stands this thread doesn't make any sense.
+1
menu_additem(hItem, "test %") works properly. Next time you should post the actual code that you have issues with.
__________________

Last edited by HamletEagle; 09-17-2018 at 03:54.
HamletEagle is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 09-17-2018 , 12:41   Re: % char in menu
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
The code that you actually posted shouldn't have any issues because that function doesn't do any formatting. If it really is having that issue, it is a bug. If you are using a function that is actually formatting a string (e.g. format() or formatex()) then %% is the proper solution.

So, if "menu_additem( hMenu, "test %", "", 0 );" doesn't work, you need to report it as a bug.

If you are using format or formatex, you should update your original post to show that because as it stands this thread doesn't make any sense.
You're right, i'm using formatex as answered previously to jocAnis but i should've said in the First post.

Thanks everyone.
__________________
marcelowzd is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 09-17-2018 , 16:28   Re: % char in menu
Reply With Quote #9

While we are here, is there a way to show % from a .txt file?
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-17-2018 , 19:05   Re: % char in menu
Reply With Quote #10

Quote:
Originally Posted by SomewhereLost View Post
While we are here, is there a way to show % from a .txt file?
The question doesn't make sense. What are you trying to do? Also better open another topic and provide more info, it's really a different question.
__________________

Last edited by klippy; 09-17-2018 at 19:06.
klippy 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:37.


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