27.03.2012, 16:19
L_Detect
Hello, I show my another creation xD.
Functions:
pawn Код:
DetectCharaters(str[]);
DetectNumbers(str[]);
Detect(str[], detect[], bool:ignorecase);
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;
}