AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu Question (https://forums.alliedmods.net/showthread.php?t=282258)

skz 05-02-2016 15:59

Menu Question
 
Its possible to make a menu with the NEWEST SYSTEM like this?

PHP Code:

Store

1. Item1    Price
x
2. Item2    Price
y
3. Item3    Price


Like, the price will be in the same place as the others

klippy 05-02-2016 16:56

Re: Menu Question
 
What do you mean by "newest system"?

That's most likely not possible with any "system". Menu fonts can vary, and they are usually not monospace. You can't have the exact position, but you can make it quite precise with some string formatting rules: http://www.cplusplus.com/reference/cstdio/printf/.

Artifact 05-02-2016 17:43

Re: Menu Question
 
Code:

menu_additem(menu, const name[], const info[]="", paccess=0, callback=-1);
so you need something like
PHP Code:

menu_additem(menu"Item1""Price X"); 


fysiks 05-02-2016 19:47

Re: Menu Question
 
It is not possible to guarantee that they would line up perfectly when using non-fixed-width fonts. However, there is a way to "right align" part of the text (but it's farther to the right than you might think; on my monitor, it's in the middle of my screen). For some reason I'm thinking "\r" is right-align but that doesn't seem correct since it might be red.

siriusmd99 05-03-2016 04:30

Re: Menu Question
 
Why don't you put 2 colums?
Item Price
1. Item1. 50$
.......

???

OciXCrom 05-03-2016 07:19

Re: Menu Question
 
Or use brackets... Item [Price]
You can use \R to align the text to the right.

Baws 05-04-2016 23:19

Re: Menu Question
 
Why don't you just put the name of the item like this: "Item 1 \y[\rPrice $\y]"
Simple.

skz 05-05-2016 10:50

Re: Menu Question
 
Quote:

Originally Posted by Baws (Post 2416768)
Why don't you just put the name of the item like this: "Item 1 \y[\rPrice $\y]"
Simple.

I think you didn't read what I requested

I want something like that:

item 1 <--distance------> price
item 2 <--same distance> price
item 3 <--same same---> price

gabuch2 05-05-2016 11:28

Re: Menu Question
 
Quote:

Originally Posted by skz (Post 2416908)
I think you didn't read what I requested

I want something like that:

item 1 <--distance------> price
item 2 <--same distance> price
item 3 <--same same---> price

>>

Quote:

Originally Posted by fysiks (Post 2416143)
It is not possible to guarantee that they would line up perfectly when using non-fixed-width fonts. However, there is a way to "right align" part of the text (but it's farther to the right than you might think; on my monitor, it's in the middle of my screen). For some reason I'm thinking "\r" is right-align but that doesn't seem correct since it might be red.


skz 05-05-2016 11:36

Re: Menu Question
 
Quote:

Originally Posted by Shattered Heart Lynx (Post 2416918)
>>


Quote:

Originally Posted by fysiks (Post 2416143)
It is not possible to guarantee that they would line up perfectly when using non-fixed-width fonts. However, there is a way to "right align" part of the text (but it's farther to the right than you might think; on my monitor, it's in the middle of my screen). For some reason I'm thinking "\r" is right-align but that doesn't seem correct since it might be red.



All times are GMT -4. The time now is 18:43.

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