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

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

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

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

Команда для личных сообщений /pm

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

Vladaman

Ученик
Команда позволяет отправлять личные сообщения. Приступим
Ко всем new добавим
PHP:
new offpm;
new adminreadpm[MAX_PLAYERS];
далее ко всем командам
PHP:
if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/пэмэ", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "{ffffff}   Залогенилса!");
            if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_LIGHTRED2, "* Писать пм можно тока с 3лвл");
            if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "Админ дал вам мут!");
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{33AA33}/pm [Id] [text]");
            if(offpm == 1) return SendClientMessage(playerid,COLOR_GREY,"* Личные сообщение выключены!");
            giveplayerid = ReturnUser(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(HidePM[giveplayerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "{ffffff}* Этот игрок офнул личные сообщения!");
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
//                    if(giveplayerid == playerid)
//                    {
//                        format(string, sizeof(string), "* %s ?? .", sendername);
//                        ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//                    }
                    new length = strlen(cmdtext);
                    while ((idx < length) && (cmdtext[idx] <= ' '))
                    {
                        idx++;
                    }
                    new offset = idx;
                    new result[64];
                    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                    {
                        result[idx - offset] = cmdtext[idx];
                        idx++;
                    }
                    result[idx - offset] = EOS;
                    if(!strlen(result)) return SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /pm [ID] [text]");
                    spaceGroupsToSpaces(result);
                    trimSideSpaces(result);
                    new word[256],Index;while(Index < strlen(result)) { 
                    word = strtok(result,Index);
                    if(Adv(word)==1||ZP(word)||U(word)||T(word)||N(word)||PP(word)||P(word)||V(word)||R(word)||PL(word)||ZV(word)||I(word)||ST(word)||PR(word)||DL(word)||RE(word)||VOC(word)||A(word)||NO(word)||TCZ(word)||BOP(word)){
                    new i=strfind(result,word),j=i+strlen(word)-1; result[i++]='[';
                    while(i<j) {result[i]='|';i++;}
                    result[j]=']';
                            SendClientMessage(playerid,COLOR_RED,"Реклама запрещена!");
                            SendClientMessage(playerid,COLOR_RED,"О рекламе узнали админы!");
                        }
                     }
                    format(string, sizeof(string), "(PM От %s (ID: %d): %s)", sendername, playerid, (result));
                    SendClientMessage(giveplayerid, COLOR_ORANGE, string);
                    format(string, sizeof(string), "(?? к %s (ID: %d): %s)", giveplayer, giveplayerid, (result));
                    SendClientMessage(playerid,  COLOR_ORANGE, string);
                    ExtortionSBiz(2, txtcost / 2);
                    //prosluwka
                    for(new admin = 0; admin < MAX_PLAYERS; admin ++)
                    {
                        if(adminreadpm[admin] ==1)
                        {
                            format(string,sizeof(string),"Прослушка: %s (id:%i), Написал к %s (id:%i): %s",sendername,playerid,giveplayer,giveplayerid,result);
                            SendClientMessage(admin,COLOR_RED,string);
                        }
                    }
                    //prosluwka
                    return 1;
                }
            }
            else
            {
                    format(string, sizeof(string), "   %d ?? ???????? ?????.", giveplayerid);
                    SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
     if(strcmp(cmd, "/offpm", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Залогенилса!");
            if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "Оффлайн собщение можно отпровлять тока с 3лвл!");
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, " ИНФО: /offpm [Name_Akk] [Message]");
            new string1[100];
            format(string1,sizeof(string1),"akk/%s.ini",tmp);
            if(!fexist(string1)) return SendClientMessage(playerid,COLOR_GREY,"Нет такова игрока");
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            { 
                        idx++; 
                        }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result)) return SendClientMessage(playerid, COLOR_GRAD2, " ИНФО: /offpm [Name_Akk] [Message]");
            if(strlen(result) > 70)
            {
                format(string,sizeof(string),"В это сообщение можно писать тока 70 симвалов. Вы написали: %d",strlen(result));
                SendClientMessage(playerid,COLOR_GREY,string);
                return 1;
            }
            new messaga = 0;
            new strste[25];
            for(new i = 0; i < 501; i++)
            {
                new File = iniOpen(string1);
                format(strste,sizeof(strste),"%d",i);
                iniGet(File,strste,string);
                iniClose(File);
                if(strlen(string) <= 3 || !strlen(string))
                {
                    break;
                }
                else if(strlen(string) > 3)
                {
                    messaga++;
                }
            }
            if(messaga > 500) return SendClientMessage(playerid,COLOR_GREY,"У этова игрока накопилось 500 сообщений. Больше ему отправить нельзя!");
            GetPlayerName(playerid,sendername,sizeof(sendername));
            format(string,sizeof(string),"%s |%s",result,sendername);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            new Ff = iniOpen(string1);
            format(strste,sizeof(strste),"%d",messaga);
            iniSet(Ff,strste,string);
            iniClose(Ff);
        }
        return 1;
    }
Автор: Lacoste
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу