Raised This Month: $ Target: $400
 0% 

Get the count of characters or words in chat.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 09-04-2009 , 18:37   Get the count of characters or words in chat.
Reply With Quote #1

I think the title says all. Is it possible?
__________________
"There is no knowledge, that is not power"
fezh is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 09-04-2009 , 18:52   Re: Get the count of characters or words in chat.
Reply With Quote #2

strlen
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 09-04-2009 , 19:12   Re: Get the count of characters or words in chat.
Reply With Quote #3

Hey, thanks, but my doubt persists. For example, how I can do it using strlen?

An example code that I wrote for this purpose:
Code:
register_clcmd( "say", "HandleSay" );

public HandleSay( id )
{
	new arg[ 128 ];
	read_args( arg, charsmax( arg ) );

	new szString = strlen( arg )
}
Is pretty obvious that I have no idea how to continue xD
__________________
"There is no knowledge, that is not power"
fezh is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 09-04-2009 , 19:18   Re: Get the count of characters or words in chat.
Reply With Quote #4

is ok. Also uso remove_quotes(arg)
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 09-04-2009 , 19:48   Re: Get the count of characters or words in chat.
Reply With Quote #5

More specifically, remove the quotes first, so you don't get a size that's two larger than it should be (because quotes were there when you got the size).

It's also going to count the number of black spaces they put before and after their message, which you can remove with trim()
__________________
Bad_Bud is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-05-2009 , 04:22   Re: Get the count of characters or words in chat.
Reply With Quote #6

Make size 191.
__________________
xPaw is offline
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 15:08.


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