AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [New style menu] +1 will appear [}] (https://forums.alliedmods.net/showthread.php?t=221415)

.Dare Devil. 07-21-2013 17:05

[New style menu] +1 will appear [}]
 
Hello Allied modders!

Basically i noticed that if there is somewhere in menu text +1 it will be [}] in the game.
Is there any way to fix this?

And as always, thanks!

ConnorMcLeod 07-22-2013 01:20

Re: [New style menu] +1 will appear [}]
 
Show some code or explain a different way plz

.Dare Devil. 07-22-2013 09:25

Re: [New style menu] +1 will appear [}]
 
alright...

this is what i see in notepad
PHP Code:

formatexbcharsmax(b), "\w%L +1"id"color_costomadd1" )
menu_additem(mb"30"

this is what i see ingame
Quote:

1. Red [}]1
I noticed that even old menu style do that.
if i but something between + and 1 then its fine, also with ohter numbers it wont do that.

ConnorMcLeod 07-22-2013 11:10

Re: [New style menu] +1 will appear [}]
 
You compiled locally ?

.Dare Devil. 07-22-2013 11:23

Re: [New style menu] +1 will appear [}]
 
Quote:

Originally Posted by ConnorMcLeod (Post 1996408)
You compiled locally ?

yes, also with variable it does the same thing

PHP Code:

formatexbcharsmax(b), "\w%L +%d"g_something

( g_something holds 1 )

Black Rose 07-22-2013 15:16

Re: [New style menu] +1 will appear [}]
 
I thought that ML coding was supposed to be this way:
Code:
formatex(str, charsmax(str), "%L", id, "LANG_KEY", 1);
Code:

LANG_KEY = \wblah blah +%d
Am I incorrect?
Statement from AMXx documentation i believe:
1. "%L" tells the string formatter to start a language translation. "%L" must always occur by itself like it is here.

Will it display the same result in a console window instead of an ingame menu?



I can't reproduce the problem.
Here's my code and result:
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Test Plugin 9", "1.0", "Black Rose");     register_dictionary("test9.txt") } public client_connect(id) {     set_task(3.0, "testfunc", id); } public testfunc(id) {     new b[1024];     new m = menu_create("Testmenu", "handler", 0);     formatex(b, charsmax(b), "\w%L +1", id, "color_costomadd1");     menu_additem(m, b, "30");     menu_display(id, m); } public handler() { }

Code:

[en]
color_costomadd1 = Red

http://DivinityX.net/images/+1_problem.png

What are you doing differently?

ConnorMcLeod 07-23-2013 00:43

Re: [New style menu] +1 will appear [}]
 
You have \w included in ML file.

Sylwester 07-23-2013 02:41

Re: [New style menu] +1 will appear [}]
 
It happens in old style menus too. When you display in menu text +<something> it will be replaced with [<key>], if +<something> is a command bound to that <key>. For example if you try to display "+use" it will be replaced with "[E]" (assuming that you have "bind e +use" in your config).

ConnorMcLeod 07-23-2013 03:07

Re: [New style menu] +1 will appear [}]
 
This is funny.
Nice to know.

bibu 07-23-2013 05:24

Re: [New style menu] +1 will appear [}]
 
Quote:

Originally Posted by ConnorMcLeod (Post 1996927)
This is funny.
Nice to know.

+1

@Sylvester:

I don't want to go off-topic, but how does it detect that at all?


All times are GMT -4. The time now is 06:26.

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