SA-MP Forums Archive
[Include] L_Detect. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] L_Detect. (/showthread.php?tid=329189)



L_Detect. - LuisGraph - 27.03.2012

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;
}



Re: L_Detect. - _DownLoaD_ - 27.03.2012

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

you sure?


Re: L_Detect. - MP2 - 27.03.2012

So basically a copy of IsNumeric()?


Re: L_Detect. - LuisGraph - 27.03.2012

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++