Raised This Month: $ Target: $400
 0% 

ColorChat message limit (check max lenght)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 12-28-2012 , 06:47   ColorChat message limit (check max lenght)
Reply With Quote #1

How i can check max lenght of message?

PHP Code:
ColorChat(0GREEN"%s is the best player of today's counter-strike party! He is 123456789012345678990 123 123 12 312123123123 123123123(for example)"winnername
In this example base lenght of message is 128 chars. If player has a long nickname (player's NICKNAME + BASE text of message), server may crashes? 191 chars limit..
I need a checker of max lenght this message..
Help me please
__________________
sorry my bad english...

Last edited by alonelive; 12-28-2012 at 06:49.
alonelive is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 12-28-2012 , 11:44   Re: ColorChat message limit (check max lenght)
Reply With Quote #2

you can limit the nickname with only 32 chars. 128+32<191
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-28-2012 , 21:00   Re: ColorChat message limit (check max lenght)
Reply With Quote #3

Quote:
Originally Posted by alonelive View Post
server may crashes?
Try it and see.
__________________
fysiks is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 12-29-2012 , 00:21   Re: ColorChat message limit (check max lenght)
Reply With Quote #4

Quote:
Originally Posted by AngeIII View Post
you can limit the nickname with only 32 chars. 128+32<191
And if i have some nicknames in this message?

The best player is Player !
or
The best player is Player, Player1, Player2, Player3 ... !
I want set a check of max lenght message.. But i don't know , how exactly i can set this.
__________________
sorry my bad english...
alonelive is offline
rastafari
Senior Member
Join Date: May 2011
Old 12-29-2012 , 01:59   Re: ColorChat message limit (check max lenght)
Reply With Quote #5

Use Notepad++, highlight the message and check its length.
__________________
rastafari is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 12-29-2012 , 03:39   Re: ColorChat message limit (check max lenght)
Reply With Quote #6

check with
native strlen(const string[]);

your length current and future (for example nick).

len=strlen(msg)
if(len+strlen(nick)>191)...
else
{
len+=strlen(nick)
...
}
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:40.


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