Anti Caps Lock
#3

I think this should work.

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(IsTextCaps(text))
    {
        SendClientMessage(playerid, 0xFF0000FF, "Turn off your caps!");
        return 0; // Will not send the text
    }
    return 1;
}

stock IsTextCaps(text[])
{
    for(new i, j = strlen(text)-1; i < j; i ++)
    {
        if(('A' <= text[i] <= 'Z') && ('A' <= text[i+1] <= 'Z')) // If the letters were in CAPS
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Anti Caps Lock - by Blackazur - 22.02.2014, 12:10
Re: Anti Caps Lock - by CutX - 22.02.2014, 12:39
Re: Anti Caps Lock - by Stinged - 22.02.2014, 12:46

Forum Jump:


Users browsing this thread: 1 Guest(s)