AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Help ] help charsmax (https://forums.alliedmods.net/showthread.php?t=308391)

Fuck For Fun 06-18-2018 16:13

[ Help ] help charsmax
 
Hey, something wrong here:

#1 - with charsmax - Not showing properly:
CheezPuff has used command.
Code:

                case MAP_MENU, KICK_MENU, BAN_MENU, SLAP_MENU, TEAM_MENU, GMENU:
                {
                        new menu[64];
                       
                        parse( CommandsName[ command ], charsmax( menu ) ); // what wrong with charsmax?
                        ColorChat( 0, "^3%s^1 has used ^4%s^1 command.",NameSz, menu)
                        client_cmd( client, "amx_%smenu", menu );
                }

#2 - without charsmax - work good than #1 > i can see in chat
CheezPuff has used Map Menu command.

Code:

                case MAP_MENU, KICK_MENU, BAN_MENU, SLAP_MENU, TEAM_MENU, GMENU:
                {
                        new menu[64];
                       
                        parse( CommandsName[ command ], menu, 63 ); // is work good with menu, 63
                        ColorChat( 0, "^3%s^1 has used ^4%s^1 command.",NameSz, menu)
                        client_cmd( client, "amx_%smenu", menu );
                }


maqi 06-18-2018 16:21

Re: [ Help ] help charsmax
 
In the first case you don't have the buffer as an argument.... There is nothing wrong with charsmax :D

Code:
parse( CommandsName[ command ], charsmax( menu ) );
-->
Code:
parse( CommandsName[ command ], menu, charsmax( menu ) );

Fuck For Fun 06-18-2018 17:20

Re: [ Help ] help charsmax
 
Quote:

Originally Posted by maqi (Post 2597802)
In the first case you don't have the buffer as an argument.... There is nothing wrong with charsmax :D

Code:
parse( CommandsName[ command ], charsmax( menu ) );
-->
Code:
parse( CommandsName[ command ], menu, charsmax( menu ) );

oh Thank you :).


It is also advisable to change this to charsmax?
Code:

parse( message, cmd, 63, arg, 63, arg1, 63, arg2, 63, arg3, 63 );

maqi 06-18-2018 17:38

Re: [ Help ] help charsmax
 
Of course, there's nothing wrong with charsmax, in fact you should use it.

fysiks 06-18-2018 22:35

Re: [ Help ] help charsmax
 
Use charsmax anytime that you are tying to get the maximum number of characters for a string variable.

Fuck For Fun 06-19-2018 04:48

Re: [ Help ] help charsmax
 
Quote:

Originally Posted by fysiks (Post 2597873)
Use charsmax anytime that you are tying to get the maximum number of characters for a string variable.

Yes, now I've read some manuals about it, thanks.


All times are GMT -4. The time now is 12:42.

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