AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Case 10 (https://forums.alliedmods.net/showthread.php?t=208111)

Kard1nal 02-10-2013 04:59

Case 10
 
So.
I've been adding a new cases in my menu and it all was okey until I added case 10.
Now I've get an error:
PHP Code:

UJBM.sma(3410) : error 027invalid character constant //this is line case('10')
UJBM.sma(3410) : warning 215expression has no effect
UJBM
.sma(3410) : error 001expected token";"but found ":"
UJBM.sma(3421) : warning 209: function "ShopT" should return a value
UJBM
.sma(3422) : error 010invalid function or declaration 

Code:
Spoiler

Unkolix 02-10-2013 05:18

Re: Case 10
 
Show us the case 10 please.

Kard1nal 02-10-2013 05:31

Re: Case 10
 
Sure.

PHP Code:

formatex(optioncharsmax(option), "Спереть фонарик - \y%d $"get_pcvar_num(T_item_10))
menu_additem(menuoption"10"0


ConnorMcLeod 02-10-2013 08:27

Re: Case 10
 
Use :

switch( item )

And start at 0

case 0:

Kard1nal 02-10-2013 09:19

Re: Case 10
 
Thanks.
Can you explain me please why does it happen with switch(data[0])?

ConnorMcLeod 02-10-2013 09:32

Re: Case 10
 
char is a char, like 0 to 9 or any letter, "10" is a string made with char '1' and char '0', so '10' is not a char.


All times are GMT -4. The time now is 20:37.

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