[FilterScript] Anti-Capital Letters
#1

Anti Capital Letter System.
This function will disable capital letters..


PHP код:
#include <a_samp>
public OnPlayerText(playeridtext[]) return DeCaps(text);
forward DeCaps(str[]);
public 
DeCaps(str[])
{
    for(new 
0strlen(str); i++) if(65 <= str[i] <= 90str[i] += 32;
    return 
1;

Reply
#2

tnx
Reply
#3

Its super easy ... Not bad
Reply
#4

Pretty Useful
Good
Reply
#5

thank you!!
Reply
#6

Change
pawn Код:
for(new i = 0; i < strlen(str); i++)
to
pawn Код:
for(new i=0,j=strlen(str); i<j; i++)
With this code you have strlen(str)-1 less function calls.
Reply
#7

Cheers!
Reply
#8

This is more a snippet rather than an actual filterscript. Besides, it will also filter out any legit capital letters. Suggest you keep track of the count and only invoke the function if the capital/lowercase ratio exceeds, say, 30%.
Reply
#9

Quote:
Originally Posted by Vince
Посмотреть сообщение
This is more a snippet rather than an actual filterscript. Besides, it will also filter out any legit capital letters. Suggest you keep track of the count and only invoke the function if the capital/lowercase ratio exceeds, say, 30%.
It's not really a filterscript indeed, but if you have a server that includes a /caps(off) command, it can be really usefull!
Reply
#10

okay :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)