Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Русификация команды /cnn

Статус
В этой теме нельзя размещать новые ответы.

.Crazy

Специалист
Вот нашол команду /cnn для модов (Обычно Role Play, в основном GF) с поддержкой русских символов. Думаю операция не сложная. Просто заменяйте свою команду на эту. Если есть недочеты или ошибки, пишем сюда.

В public OnPlayerCommandText заменяем(вставляем):
PHP:
if(strcmp(cmd, "/cnn", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 2)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                    if (cmdtext[idx] == '~'&& cmdtext[idx+2] != '~')
                    {
                     if (((cmdtext[idx+1] != 'n')||(cmdtext[idx+1] != 'r')||(cmdtext[idx+1] != 'g')||(cmdtext[idx+1] != 'b')||(cmdtext[idx+1] != 'w')||(cmdtext[idx+1] != 'y'))&&(cmdtext[idx+2] != '~')||(cmdtext[idx+2] == '~'))
                     {
                           SendClientMessage(playerid, COLOR_GRAD2, " Недопустимые символы!");
                          return 1;
                     }
                    }
                }
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    if(result[idx - offset] == 'А'||result[idx - offset] == 'а')
                    {
                    result[idx - offset]= '»';
                    }
                    else if(result[idx - offset] == 'Б'||result[idx - offset] == 'б')
                    {
                    result[idx - offset]= 'Ђ';
                    }
                    else if(result[idx - offset] == 'В'||result[idx - offset] == 'в')
                    {
                    result[idx - offset]= '‹';
                    }
                    else if(result[idx - offset] == 'Г'||result[idx - offset] == 'г')
                    {
                    result[idx - offset]= '™';
                    }
                    else if(result[idx - offset] == 'Д'||result[idx - offset] == 'д')
                    {
                    result[idx - offset]= 'ѓ';
                    }
                    else if(result[idx - offset] == 'Е'||result[idx - offset] == 'е')
                    {
                    result[idx - offset]= 'E';
                    }
                    else if(result[idx - offset] == 'Ё'||result[idx - offset] == 'ё')
                    {
                    result[idx - offset]= 'E';
                    }
                    else if(result[idx - offset] == 'Ж'||result[idx - offset] == 'ж')
                    {
                    result[idx - offset]= '„';
                    }
                    else if(result[idx - offset] == 'З'||result[idx - offset] == 'з')
                    {
                    result[idx - offset]= '?';
                    }
                    else if(result[idx - offset] == 'И'||result[idx - offset] == 'и')
                    {
                    result[idx - offset]= '…';
                    }
                    else if(result[idx - offset] == 'Й'||result[idx - offset] == 'й')
                    {
                    result[idx - offset]= '†';
                    }
                    else if(result[idx - offset] == 'К'||result[idx - offset] == 'к')
                    {
                    result[idx - offset]= 'Е';
                    }
                    else if(result[idx - offset] == 'Л'||result[idx - offset] == 'л')
                    {
                    result[idx - offset]= '‡';
                    }
                    else if(result[idx - offset] == 'М'||result[idx - offset] == 'м')
                    {
                    result[idx - offset]= '–';
                    }
                    else if(result[idx - offset] == 'Н'||result[idx - offset] == 'н')
                    {
                    result[idx - offset]= 'м';
                    }
                    else if(result[idx - offset] == 'О'||result[idx - offset] == 'о')
                    {
                    result[idx - offset]= 'Й';
                    }
                    else if(result[idx - offset] == 'П'||result[idx - offset] == 'п')
                    {
                    result[idx - offset]= 'Њ';
                    }
                    else if(result[idx - offset] == 'Р'||result[idx - offset] == 'р')
                    {
                    result[idx - offset]= 'К';
                    }
                    else if(result[idx - offset] == 'С'||result[idx - offset] == 'с')
                    {
                    result[idx - offset]= 'C';
                    }
                    else if(result[idx - offset] == 'Т'||result[idx - offset] == 'т')
                    {
                    result[idx - offset]= 'Џ';
                    }
                    else if(result[idx - offset] == 'У'||result[idx - offset] == 'у')
                    {
                    result[idx - offset]= 'У';
                    }
                    else if(result[idx - offset] == 'Ф'||result[idx - offset] == 'ф')
                    {
                    result[idx - offset]= 'Ц';
                    }
                    else if(result[idx - offset] == 'Х'||result[idx - offset] == 'х')
                    {
                    result[idx - offset]= 'Т';
                    }
                    else if(result[idx - offset] == 'Ц'||result[idx - offset] == 'ц')
                    {
                    result[idx - offset]= '‰';
                    }
                    else if(result[idx - offset] == 'Ч'||result[idx - offset] == 'ч')
                    {
                    result[idx - offset]= 'Ќ';
                    }
                    else if(result[idx - offset] == 'Ш'||result[idx - offset] == 'ш')
                    {
                    result[idx - offset]= 'Ћ';
                    }
                    else if(result[idx - offset] == 'Щ'||result[idx - offset] == 'щ')
                    {
                    result[idx - offset]= 'Љ';
                    }
                    else if(result[idx - offset] == 'Ъ'||result[idx - offset] == 'ъ')
                    {
                    result[idx - offset]= '’';
                    }
                    else if(result[idx - offset] == 'Ы'||result[idx - offset] == 'ы')
                    {
                    result[idx - offset]= '‘';
                    }
                    else if(result[idx - offset] == 'Ь'||result[idx - offset] == 'ь')
                    {
                    result[idx - offset]= 'ђ';
                    }
                    else if(result[idx - offset] == 'Э'||result[idx - offset] == 'э')
                    {
                    result[idx - offset]= '“';
                    }
                    else if(result[idx - offset] == 'Ю'||result[idx - offset] == 'ю')
                    {
                    result[idx - offset]= '”';
                    }
                    else if(result[idx - offset] == 'Я'||result[idx - offset] == 'я')
                    {
                    result[idx - offset]= '•';
                    }
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Используй /cnn [stmh формат ~n~=новая_строка ~r~=красный ");
                    SendClientMessage(playerid, COLOR_GRAD2, "~g~=зеленый ~b~=синий ~w~=белый ~y~=желтый]");
                    return 1;
                }
                format(string, sizeof(string), "~b~%s: ~w~%s",sendername,result);
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        GameTextForPlayer(i, string, 5000, 6);
                    }
                }
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "У Вас нет прав на использование этой команды!");
                return 1;
            }
        }
        return 1;
    }
Автор: Cruze
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу