Caps lock on command.
#6

pawn Код:
stock IsCaps(text[])
{
    new count = 0;
    for(new i = 0, j = strlen(text) - 1; i < j; i++)
    {
        if('A' <= text[i] <= 'Z') count++;
    }
    return (count >= 6) ? (true) : (false);
}

CMD:s(playerid, params[]) return cmd_shout(playerid, params);
CMD:shout(playerid, params[])
{
    new shout[90];
    if(sscanf(params, "s[90]", shout)) return SendClientMessage(playerid, -1, ""COL_CYAN"[KORISTI]: "COL_WHITE"/(s)hout [text]");
    if(IsCaps(shout)) return SendClientMessage( playerid, -1, ""COL_RED"[GRESKA]: "COL_WHITE"Ne mozete pisati Caps Lockom, velika slova oznacavaju sukob! "COL_RED"Iskljucite"COL_WHITE" Caps Lock"COL_RED"!" );
    new string[128];
    format(string, sizeof(string), "%s se dere: %s!!", GetName(playerid), shout);
    ProxDetector(50.0, playerid, string, -1);
    return 1;
}
pawn Код:
return (count >= 6) ? (true) : (false);
This line determines the limit for caps lock. If you want to change it to 8 capital characters, change the 6 to an 8.
Reply


Messages In This Thread
Caps lock on command. - by TiXz0r - 09.10.2014, 11:08
Re: Caps lock on command. - by RoboN1X - 09.10.2014, 11:31
Re: Caps lock on command. - by TiXz0r - 09.10.2014, 12:54
Re: Caps lock on command. - by YanLanger - 09.10.2014, 14:33
Re: Caps lock on command. - by TiXz0r - 09.10.2014, 21:35
Re: Caps lock on command. - by Threshold - 10.10.2014, 02:06
Re: Caps lock on command. - by TiXz0r - 10.10.2014, 13:51

Forum Jump:


Users browsing this thread: 1 Guest(s)