[Include] L_Detect.
#1

L_Detect



Hello, I show my another creation xD.



Functions:

pawn Код:
DetectCharaters(str[]);
DetectNumbers(str[]);
Detect(str[], detect[], bool:ignorecase);
DetectCharaters(str[]);

This function was introduced to detect any alphabetic character introduced in the chain.

Example.

pawn Код:
public OnPlayerText(playerid, text[])
{
        if(DetectCharaters(text))
        {
             SendClientMessage(playerid, -1, Alphabetic characters not allowed);
             return 0;
        }
    return 1;
}

DetectNumbers(str[]);

This function was introduced to detect any alphanumeric character introduced in the chain.

Example.


pawn Код:
public OnPlayerText(playerid, text[])
{
        if(DetectNumbers(text))
        {
             SendClientMessage(playerid, -1, Alphanumeric characters not allowed);
             return 0;
        }
    return 1;
}

Detect(str[], detect[], bool:ignorecase);

This detects a specific character in a string
ignorecase = true/false mayusc...

Example

pawn Код:
public OnPlayerText(playerid, text[])
{
        if(Detect(text, "1", true))
        {
             SendClientMessage(playerid, -1, "characters not allowed);
             return 0;
        }
        if(Detect(text, "
g", true))
        {
            SendClientMessage(playerid, -1, "
characters not allowed);
        }
    return 1;
}
Reply
#2

SendClientMessage(playerid, -1, "characters not allowed);

you sure?
Reply
#3

So basically a copy of IsNumeric()?
Reply
#4

I had never heard of IsNumeric(), I am not very active in the creations of users in English, I did tah system from 0 without noticing anything is a very basic in C++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)