AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Blanks can only be added after items. (https://forums.alliedmods.net/showthread.php?t=243016)

Fuck For Fun 06-28-2014 11:40

[HELP] Blanks can only be added after items.
 
Fixed

Flick3rR 06-28-2014 12:55

Re: [HELP] Blanks can only be added after items.
 
Your loops, where you add blank and the items, are wrong. And the compiler says it itself.

Nextra 06-28-2014 16:12

Re: [HELP] Blanks can only be added after items.
 
You always have to add an item first before adding a blank using menu_addblank. The code you have provided should not trigger this behavior since you always use menu_additem first before reaching menu_addblank.

Fuck For Fun 06-28-2014 18:44

Re: [HELP] Blanks can only be added after items.
 
Quote:

Originally Posted by Flick3rR (Post 2158802)
Your loops, where you add blank and the items, are wrong. And the compiler says it itself.

Quote:

Originally Posted by Nextra (Post 2158901)
You always have to add an item first before adding a blank using menu_addblank. The code you have provided should not trigger this behavior since you always use menu_additem first before reaching menu_addblank.

Look good on the stock Cmd MakeShop
menu_additem and blank
Can you answer my questions - 192 characters

Flick3rR 06-28-2014 18:52

Re: [HELP] Blanks can only be added after items.
 
You.don't really need 192. That's too many. Simply explained - this shows how many characters can you have in your string (inthat case)(it could be array also). Usually, you may use 32 or 64 for titles.

Nextra 06-28-2014 22:38

Re: [HELP] Blanks can only be added after items.
 
Quote:

Originally Posted by Fuck For Fun (Post 2158941)
Can you answer my questions - 192 characters

It doesn't matter for this problem, the menu system doesn't care how large the array is. You will probably never use display text longer than 63 characters, so you can reduce the size to 64 if you like.

Fuck For Fun 06-30-2014 10:59

Re: [HELP] Blanks can only be added after items.
 
How will I know how to set up?
50 It is good to this menu?

Flick3rR 06-30-2014 12:40

Re: [HELP] Blanks can only be added after items.
 
Yes. You have to understand one: the size you put in these brackets after the variable defines how many letters could there be in this string (in that case it is the menu title). If you won't use more than 63, you can put 64. These numbers like 32, 64, 128, etc., are mostly used, because hey are multiples of 2 (it's a principle in the programming).

Fuck For Fun 06-30-2014 15:52

Re: [HELP] Blanks can only be added after items.
 
Oh it is based on the amount of letters.
Code:

formatex( szMenu, charsmax( szMenu ), "\r[%s] \yShop Main Menu^n\wYou have \y%i \wcash"
So I will set 64?
Code:

static szMenu[ 64 ]
What is the difference between static to new
Has been explained to me the other day, but for you what is useful for me here on the menu?

Nextra 07-01-2014 06:21

Re: [HELP] Blanks can only be added after items.
 
The menu does not care about what your variable is, it just cares about what string is inside it. It doesn't care wether the variable is declared new or static. Static is not needed for this function.


All times are GMT -4. The time now is 21:05.

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