#1

How do I block the use of more than 4 numbers per sentence??
Reply
#2

You want a message like?"Only 4 characters"
or just put there only 4 letters ?
Reply
#3

for example:
buy house for 12mil -> ok phrase

buy home for 12345mil -> phrase blocked


I thereby avoid disclosure of other server
Reply
#4

pawn Код:
stock IsNumber(c[])
{
    new bool:match;
    switch(c[0]) {
        case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': match = true;
        default: match = false;
    }
    return match;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    new count;
    for(new i=0; i<strlen(text); i++) {
        if(IsNumber(text[i])) {
            count++;
        }
    }
    if(count > 4) {
        SendClientMessage(playerid, -1, "No more than 4 numbers allowed");
        return 0;
    }
    return 1;
}
Try that. Don't know if it's the best way to do it, but it should work!
Reply
#5

thanks man
works 100%
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)