AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get the count of characters or words in chat. (https://forums.alliedmods.net/showthread.php?t=102654)

fezh 09-04-2009 18:37

Get the count of characters or words in chat.
 
I think the title says all. Is it possible?

AntiBots 09-04-2009 18:52

Re: Get the count of characters or words in chat.
 
strlen :D

fezh 09-04-2009 19:12

Re: Get the count of characters or words in chat.
 
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

AntiBots 09-04-2009 19:18

Re: Get the count of characters or words in chat.
 
is ok. Also uso remove_quotes(arg)

Bad_Bud 09-04-2009 19:48

Re: Get the count of characters or words in chat.
 
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()

xPaw 09-05-2009 04:22

Re: Get the count of characters or words in chat.
 
Make size 191.


All times are GMT -4. The time now is 15:08.

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