1. Apache20.11.2026 в 23:41от
Загрузка...

[Урок] Как создать Таксафон

Тема в разделе "Grand Theft Auto", создана пользователем Ballard, 23.11.2012.

  1. Ballard

    Ballard

    Статус:
    Оффлайн
    Регистрация:
    23.11.12
    Сообщения:
    2
    Репутация:
    3 +/-
    Привет решил написать систему таксофонов
    Можно на улицах подходить к таксофону и звонить на номер другу и тд. командой /call
    ко всем new добовляем
    PHP:
    new Payphone[MAX_PLAYERS];
    new 
    Mobile[MAX_PLAYERS];
    ко всем forward добовляем
    PHP:
    forward IsAtPayphone(playerid);
    PHP:
    forward HidePhone(playerid);
    forward SendTeamMessage(team, color, string[]);
    в enum pInfo:
    PHP:
    pTA,//деньги на телефоне
    pHideNumber,//Номер телефона
    перед public OnPlayerDisconnect(playerid, reason)
    ставим паблик
    PHP:
    public IsAtPayphone(playerid)
    {
        if(
    IsPlayerConnected(playerid))
        {
            if(
    PlayerToPoint(2.0,playerid,1805.8915,-1600.8894,13.5469)) return 1; // телефон автомат у тюрьмы - 1
            
    else if(PlayerToPoint(2.0,playerid, 1806.7111,-1599.9607,13.5469)) return 1; // телефон автомат у тюрьмы - 2
            
    else if(PlayerToPoint(2.0,playerid, 1807.6871,-1599.1393,13.5469)) return 1; // телефон автомат у тюрьмы - 3
            
    else if(PlayerToPoint(2.0,playerid, 1808.6970,-1598.2676,13.5469)) return 1; // телефон автомат у тюрьмы - 4
            
    else if(PlayerToPoint(2.0,playerid, 1809.6656,-1597.4368,13.5469)) return 1; // телефон автомат у тюрьмы - 5
            
    else if(PlayerToPoint(2.0,playerid, 1710.4701,-1604.8776,13.5469)) return 1; // таксофон артриум - 2
            
    else if(PlayerToPoint(2.0,playerid, 1711.3196,-1605.5674,13.5469)) return 1; // таксофон артриум - 1
            
    else if(PlayerToPoint(2.0,playerid, 295.0905,-1573.5332,33.4427))  return 1; // таксофон отель у автошколы 1
            
    else if(PlayerToPoint(2.0,playerid, 296.7084,-1573.7710,33.4631))  return 1; // таксофон отель у автошколы 2
            
    else if(PlayerToPoint(2.0,playerid, 303.1015,-1592.8331,32.8495))  return 1; // таксофон отель у автошколы2 1
            
    else if(PlayerToPoint(2.0,playerid, 302.1358,-1592.7343,32.8115))  return 1; // таксофон отель у автошколы2 2
            
    else if(PlayerToPoint(2.0,playerid, 279.6747,-1630.7975,33.3107))  return 1; // таксофон отель у автошколы2 3
            
    else if(PlayerToPoint(2.0,playerid, 278.0888,-1630.6023,33.3104))  return 1; // таксофон отель у автошколы2 4
            
    else if(PlayerToPoint(2.0,playerid, 2257.7419,-1211.6727,23.9688)) return 1; // таксофон, за джеферсоном 1
            
    else if(PlayerToPoint(2.0,playerid, 2259.2512,-1211.6838,23.9688)) return 1; // таксофон, за джеферсоном 2
            
    else if(PlayerToPoint(2.0,playerid, 1721.2006,-1720.4731,13.5416)) return 1; // таксофон артриум 3
            
    else if(PlayerToPoint(2.0,playerid, 1721.1951,-1721.3274,13.5454)) return 1; // таксофон артриум 4
            
    else if(PlayerToPoint(2.0,playerid, 1723.0820,-1721.2474,13.5468)) return 1; // таксофон артриум 5
            
    else if(PlayerToPoint(2.0,playerid, 1723.0801,-1720.3872,13.5394)) return 1; // таксофон артриум 6
            
    else if(PlayerToPoint(2.0,playerid, 356.8147,-1364.4952,14.4850))  return 1; // таксофон северная улица лс 1
            
    else if(PlayerToPoint(2.0,playerid, 355.3643,-1365.1548,14.4661))  return 1; // таксофон северная улица лс 2
            
    else if(PlayerToPoint(2.0,playerid, 338.8322,-1397.2825,14.2228))  return 1; // таксофон северная улица лс 3
            
    else if(PlayerToPoint(2.0,playerid, 339.9358,-1397.6555,14.3896))  return 1; // таксофон северная улица лс 4
            
    else if(PlayerToPoint(2.0,playerid, 339.5755,-1398.7756,14.3890))  return 1; // таксофон северная улица лс 5
            
    else if(PlayerToPoint(2.0,playerid, 338.3472,-1398.7109,14.3734))  return 1; // таксофон северная улица лс 6
            
    else if(PlayerToPoint(2.0,playerid, 523.1959,-1526.4417,14.8026))  return 1; // таксофоны, неподалеку от автошколы 1
            
    else if(PlayerToPoint(2.0,playerid, 522.3254,-1525.6119,14.7490))  return 1; // таксофоны, неподалеку от автошколы 2
            
    else if(PlayerToPoint(2.0,playerid, 523.1973,-1524.7677,14.6949))  return 1; // таксофоны, неподалеку от автошколы 3
            
    else if(PlayerToPoint(2.0,playerid, 523.9938,-1525.6340,14.7482))  return 1; // таксофоны, неподалеку от автошколы 4
            
    else if(PlayerToPoint(2.0,playerid, 523.1372,-1517.2546,14.6006))  return 1; // таксофоны, неподалеку от автошколы 5
            
    else if(PlayerToPoint(2.0,playerid, 522.3214,-1516.3606,14.5958))  return 1; // таксофоны, неподалеку от автошколы 6
            
    else if(PlayerToPoint(2.0,playerid, 523.1416,-1515.5714,14.5915))  return 1; // таксофоны, неподалеку от автошколы 7
            
    else if(PlayerToPoint(2.0,playerid, 524.0108,-1516.4266,14.5961))  return 1; // таксофоны, неподалеку от автошколы 8
            
    else if(PlayerToPoint(2.0,playerid, 2069.4102,-1767.8351,13.5622)) return 1; // таксофон, гетто, пейандспрей - 1
            
    else if(PlayerToPoint(2.0,playerid, 2069.4695,-1766.6896,13.5627)) return 1; // таксофон, гетто, пейандспрей - 2
            
    else if(PlayerToPoint(2.0,playerid, -1967.3879,162.3943,27.6875))  return 1; // таксофон вокзал сф 1
            
    else if(PlayerToPoint(2.0,playerid, -1966.2800,162.3970,27.6875))  return 1; // таксофон вокзал сф 2
            
    else if(PlayerToPoint(2.0,playerid, -1965.1171,162.3969,27.6875))  return 1; // таксофон вокзал сф 3
            
    else if(PlayerToPoint(2.0,playerid, -1964.1456,162.3980,27.6875))  return 1; // таксофон вокзал сф 4
            
    else if(PlayerToPoint(2.0,playerid, 2166.3914,-1155.7433,24.8626)) return 1; // еще таксофон у джефферсона 1
            
    else if(PlayerToPoint(2.0,playerid, 2166.3933,-1154.9111,24.8758)) return 1; // еще таксофон у джефферсона 2
            
    else if(PlayerToPoint(2.0,playerid, 378.6402,-1717.1147,23.4408))  return 1; // таксофон въезд на пирс 1
            
    else if(PlayerToPoint(2.0,playerid, 378.6397,-1717.9363,23.2052))  return 1; // таксофон въезд на пирс 2
            
    else if(PlayerToPoint(2.0,playerid, 383.2906,170.0077,1008.3828))  return 1; // таксофон в мэрии 1
            
    else if(PlayerToPoint(2.0,playerid, 381.6122,170.0071,1008.3828))  return 1; // таксофон в мэрии 2
            
    else if(PlayerToPoint(2.0,playerid, 379.8120,170.0071,1008.3828))  return 1; // таксофон в мэрии 3
            
    else if(PlayerToPoint(2.0,playerid, 638.0289,-1227.5535,18.1406))  return 1; // таксофон у тенисных кортов 1
            
    else if(PlayerToPoint(2.0,playerid, 638.0356,-1229.1333,18.0745))  return 1; // таксофон у тенисных кортов 2
        
    }
        return 
    0;
    }
    Удаляем команду /call
    ставим новую команду /call
    PHP:
    if(strcmp(cmd, "/call", true) == 0)
        {
            if(
    IsPlayerConnected(playerid))
            {
                
    tmp = strtok(cmdtext, idx);
                if(!
    strlen(tmp))
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Помощь: /call [номер телефона]");
                    return 
    1;
                }
                if(
    PhoneOnline[playerid] == 1)
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Ваш мобильный выключен! Прежде чем звонить - включите его! (/togphone)");
                    return 
    1;
                }
                if(
    PlayerInfo[playerid][pJailed] > 0)
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "У вас отобрали телефон на время заключения.");
                    return 
    1;
                }
                if(
    PlayerInfo[playerid][pPnumber] == 0)
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "У вас нет мобильного телефона телефона.");
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Приобрести телефон можно в сетях магазинов 24/7");
                    return 
    1;
                }
                if(
    PlayerCuffed[playerid] > 0)
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Вы не можете позвонить, т.к. у вас заняты руки!");
                    return 
    1;
                }
                if(
    PlayerInfo[playerid][pTA] <= 0)
                {
                    
    SendClientMessage(playerid, COLOR_GRAD1, "Ваш номер заблокирован. Вам необходимо пополнить баланс.");
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Помощь: Это можно сделать в любом магазине из сети 24\7.");
                    
    SendClientMessage(playerid, COLOR_GRAD3, "Помощь: /account [кол-во денег] чтобы пополнить ваш счет.");
                    return 
    1;
                }
                if(
    Mobile[playerid] != 255)
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Вы уже звоните!");
                    return 
    1;
                }
                
    GetPlayerName(playerid, sendername, sizeof(sendername));
                
    format(string, sizeof(string), "* %s нaбupaeт нoмep.", sendername);
                
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                new 
    phonenumb = strval(tmp);
                
    SetPlayerSpecialAction ( playerid , SPECIAL_ACTION_USECELLPHONE );
                if(
    phonenumb == 911)
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "ДИСПЕТЧЕР: Кого вы хотите вызвать? полицию (02) или медика (03) ");
                    
    Mobile[playerid] = 911;
                    return 
    1;
                }
                if(
    phonenumb == PlayerInfo[playerid][pPnumber])
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "** Абонент занят **");
                    
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                    return 
    1;
                }
                for(new 
    i = 0; i < MAX_PLAYERS; i++)
                {
                    if(
    IsPlayerConnected(i))
                    {
                        if(
    PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
                        {
                            
    giveplayerid = i;
                            
    Mobile[playerid] = giveplayerid; //caller connecting
                            
    if(IsPlayerConnected(giveplayerid))
                            {
                                if(
    giveplayerid != INVALID_PLAYER_ID)
                                {
                                    if(
    PhoneOnline[giveplayerid] > 0)
                                    {
                                        
    SendClientMessage(playerid, COLOR_GREY, "** Абонент недоступен **");
                                        
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                                        return 
    1;
                                    }
                                    if(
    PlayerInfo[giveplayerid][pJailed] > 0)
                                    {
                                        
    SendClientMessage(playerid, COLOR_GREY, "** Абонент недоступен **");
                                        
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                                        return 
    1;
                                    }
                                    if (
    Mobile[giveplayerid] == 255)
                                    {
                                        if(
    IsAtPayphone(playerid)) format(string, sizeof(string), " Ваш телефон зазвонил, введите (/p) Вызывает: Неизвестный входящий"); //modif
                                        
    else format(string, sizeof(string), " Ваш телефон зазвонил, введите (/Pickup) Вызывает: %d", PlayerInfo[playerid][pPnumber]); //modif
                                    //    format(string, sizeof(string), "Baш мoбuльнuk звoнuт. Aбoнeнт: %s", sendername);
                                        
    SendClientMessage(giveplayerid, COLOR_YELLOW2, string);
                                        
    GetPlayerName(giveplayerid, sendername, sizeof(sendername));
                                        
    RingTone[giveplayerid] = 10;
                                        
    format(string, sizeof(string), "** У %s звонит телефон.", sendername);
                                        
    ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        
    CellTime[playerid] = 1;
                                        if(
    IsAtPayphone(playerid))
                                        {
                                            
    Payphone[playerid]=1;
                                            
    TogglePlayerControllable(playerid,0);
                                        }
                                        return 
    1;
                                    }
                                }
                            }
                        }
                    }
                }
                
    SendClientMessage(playerid, COLOR_GRAD2, "** Абонент занят **");
                
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
            }
            return 
    1;
        }
    и
    PHP:
    if(strcmp(cmd, "/пополнить", true) == 0 || strcmp(cmd, "/account", true) == 0)
        {
            if(
    IsPlayerConnected(playerid))
            {
                if (!
    PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53))
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Вы не в супермаркете/магазине.");
                    return 
    1;
                }
                
    ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Пополнение счета","Введите сумму которую хотите положить на счёт мобильного","Ок","Отмена");
             }
             return 
    1;
        }
    public OnplayerText(playerid, text[])
    там ищите первую строку if(Mobile[playerid] != 255) или в поиске найдите
    весь текст и удалите и вставьте вот этот текст

    PHP:
    if(Mobile[playerid] != 255)
        {
            new 
    idx;
            
    tmp = strtok(text, idx);
            
    GetPlayerName(playerid, sendername, sizeof(sendername));
            
    format(string, sizeof(string), "%s Говорит (сотовый телефон): %s", sendername, text);
            
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5,0,0);
            
    //printf("callers line %d called %d caller %d",Mobile[Mobile[playerid]],Mobile[playerid],playerid);
            
    if(Mobile[playerid] == 914)
            {
                if(!
    strlen(tmp))
                {
                    
    SendClientMessage(playerid, TEAM_CYAN_COLOR, "Служба спасения: Я не понимаю вас");
                    return 
    0;
                }
                new 
    turner[MAX_PLAYER_NAME];
                new 
    wanted[128];
                
    GetPlayerName(playerid, turner, sizeof(turner));
                
    SendClientMessage(playerid, TEAM_CYAN_COLOR, "Служба спасения: Мы привели в готовность все единицы в области.");
                
    SendClientMessage(playerid, TEAM_CYAN_COLOR, "Спасибо за сообщение об этом инциденте");
                
    format(wanted, sizeof(wanted), "Служба спасения: Все Единицы IA: Гость: %s",turner);
                
    SendTeamBeepMessage(1, TEAM_CYAN_COLOR, wanted);
                
    format(wanted, sizeof(wanted), "Служба спасения: инцидент: %s",text);
                
    SendTeamMessage(1, TEAM_CYAN_COLOR, wanted);
                
    SendClientMessage(playerid, COLOR_GRAD2, "   Они Повесили трубку...");
                
    Mobile[playerid] = 255;
                return 
    0;
            }
            if(
    Mobile[playerid] == 913)
            {
                if(!
    strlen(tmp))
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "МЧС: Я не понимаю вас");
                    return 
    0;
                }
                if ((
    strcmp("no", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("no")))
                {
                    new 
    turner[MAX_PLAYER_NAME];
                    new 
    wanted[128];
                    
    GetPlayerName(playerid, turner, sizeof(turner));
                    
    SendClientMessage(playerid, COLOR_DBLUE, "Полицейский ШТАБ - КВАРТИРА: Мы привели в готовность все единицы в области.");
                    
    SendClientMessage(playerid, COLOR_DBLUE, "Спасибо за сообщение об этом преступлении");
                    
    format(wanted, sizeof(wanted), "ШТАБ - КВАРТИРА: Все Единицы APB: Репортер: %s",turner);
                    
    SendFamilyMessage(1, COLOR_DBLUE, wanted);
                    
    format(wanted, sizeof(wanted), "ШТАБ - КВАРТИРА: Преступление: %s, Подозреваемый: Неизвестный",PlayerCrime[playerid][pAccusing]);
                    
    SendFamilyMessage(1, COLOR_DBLUE, wanted);
                    
    SendClientMessage(playerid, COLOR_GRAD2, "   Они Повесили трубку...");
                    
    Mobile[playerid] = 255;
                    return 
    0;
                }
                new 
    badguy;
                
    //badguy = strval(tmp);
                
    badguy = ReturnUser(tmp);
                if (
    IsPlayerConnected(badguy))
                {
                    if(
    badguy != INVALID_PLAYER_ID)
                    {
                        if (
    gTeam[badguy] == 2 || gTeam[badguy] == 1)
                        {
                            
    SendClientMessage(playerid, COLOR_DBLUE, "Полицейский ШТАБ - КВАРТИРА: Вы должны будете связаться с внутренними делами. Это - чрезвычайная линия");
                            
    SendClientMessage(playerid, COLOR_GRAD2, "   Они Повесили трубку...");
                            
    Mobile[playerid] = 255;
                            return 
    0;
                        }
                        if (
    WantedPoints[badguy] > 0)
                        {
                            
    SendClientMessage(playerid, COLOR_DBLUE, "Полицейский ШТАБ - КВАРТИРА: Единицы уже назначены на этот случай");
                            
    SendClientMessage(playerid, COLOR_DBLUE, "Спасибо за сообщение об этом преступлении");
                            
    SendClientMessage(playerid, COLOR_GRAD2, "   Они Повесили трубку...");
                            
    Mobile[playerid] = 255;
                            return 
    0;
                        }
                        if (
    badguy == playerid)
                        {
                            
    SendClientMessage(playerid, COLOR_DBLUE, "Полицейский ШТАБ - КВАРТИРА: не Дурачьтесь, Это - чрезвычайная линия.");
                            
    SendClientMessage(playerid, COLOR_GRAD2, "   Они Повесили трубку...");
                            
    Mobile[playerid] = 255;
                            return 
    0;
                        }
                        
    SendClientMessage(playerid, COLOR_DBLUE, "Полицейский ШТАБ - КВАРТИРА: Мы привели в готовность все единицы в области.");
                        
    SendClientMessage(playerid, COLOR_DBLUE, "Спасибо за сообщение об этом преступлении");
                        
    SetPlayerCriminal(badguy,playerid, PlayerCrime[playerid][pAccusing]);
                        if(
    WantedPoints[badguy] > 0) { } else { WantedPoints[badguy] += 2; }
                        
    SendClientMessage(playerid, COLOR_GRAD2, "   Они Повесили трубку...");
                        
    Mobile[playerid] = 255;
                        return 
    0;
                    }
    //invalid id
                    
    return 0;
                }
    //not connected
                
    else
                {
                    
    format(string, sizeof(string), "Полицейский ШТАБ - КВАРТИРА: у меня нет никакой информации о подозреваемом укажите данные о нем",tmp);
                    
    SendClientMessage(playerid, COLOR_DBLUE, string);
                    return 
    0;
                }
            }
            if(
    Mobile[playerid] != 255)
        {
            new 
    idx;
            
    tmp = strtok(text, idx);
            
    GetPlayerName(playerid, sendername, sizeof(sendername));
            
    format(string, sizeof(string), "%s гoвopuт (в тeл.): %s", sendername, text);
            
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            if(
    Payphone[playerid]==1)
            {
                
    format(string, sizeof(string), "Unknown caller говорит (в трубку): %s", text);
            }
            
    //printf("callers line %d called %d caller %d",Mobile[Mobile[playerid]],Mobile[playerid],playerid);
            
    if(Mobile[playerid] == 914)
            {
                if(!
    strlen(tmp))
                {
                    
    SendClientMessage(playerid, TEAM_CYAN_COLOR, "Диспетчер: 'Извините, вас плохо слышно...'");
                    return 
    0;
                }
                new 
    turner[MAX_PLAYER_NAME];
                new 
    wanted[128];
                
    GetPlayerName(playerid, turner, sizeof(turner));
                
    SendClientMessage(playerid, TEAM_CYAN_COLOR, "Диспетчер: 'Мы предупредим все подразделения в вашем районе.'");
                
    SendClientMessage(playerid, TEAM_CYAN_COLOR, "Спасибо за сообщение об инциденте.");
                
    format(wanted, sizeof(wanted), "Bceм nocтaм! Oт: %s",turner);
                
    SendFamilyMessage(4, TEAM_CYAN_COLOR, wanted);
                
    format(wanted, sizeof(wanted), "Инцuдeнт: %s",text);
                
    SendFamilyMessage(4, TEAM_CYAN_COLOR, wanted);
                
    SendClientMessage(playerid, COLOR_GRAD2, "*** Звонок закончен ***");
                
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                
    Mobile[playerid] = 255;
                return 
    0;
            }
            if(
    Mobile[playerid] == 913)
            {
                if(!
    strlen(tmp))
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "911: 'Извините, но вас плохо слышно...'");
                    return 
    0;
                }
                if ((
    strcmp("нет", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("нет")))
                {
                    new 
    turner[MAX_PLAYER_NAME];
                    new 
    wanted[128];
                    
    GetPlayerName(playerid, turner, sizeof(turner));
                    
    SendClientMessage(playerid, COLOR_DBLUE, "Диспетчер: 'Все посты были предупреждены.'");
                    
    SendClientMessage(playerid, COLOR_DBLUE, "Спасибо что доложили о преступлении.");
                    
    format(wanted, sizeof(wanted), "Bceм nocтaм! Oт: %s",turner);
                    
    SendFamilyMessage(1, COLOR_DBLUE, wanted);
                    
    format(wanted, sizeof(wanted), "* Coвepшeнo npecтynлeнue: %s.",PlayerCrime[playerid][pAccusing]);
                    
    SendFamilyMessage(1, COLOR_DBLUE, wanted);
                    
    SendClientMessage(playerid, COLOR_GRAD2, "*** Звонок закончен ***");
                    
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                    
    Mobile[playerid] = 255;
                    return 
    0;
                }
                new 
    badguy;
                
    //badguy = strval(tmp);
                
    badguy = ReturnUser(tmp);
                if (
    IsPlayerConnected(badguy))
                {
                    if(
    badguy != INVALID_PLAYER_ID)
                    {
                        if (
    gTeam[badguy] == 2 || gTeam[badguy] == 1)
                        {
                            
    SendClientMessage(playerid, COLOR_DBLUE, "PHQ: Если вы шутите, то зря...Это экстренная линия.");
                            
    SendClientMessage(playerid, COLOR_GRAD2, "*** Звонок закончен ***");
                            
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                            
    Mobile[playerid] = 255;
                            return 
    0;
                        }
                        if (
    WantedPoints[badguy] > 0)
                        {
                            
    SendClientMessage(playerid, COLOR_DBLUE, "Диспетчер: 'Все посты были предупреждены.'");
                            
    SendClientMessage(playerid, COLOR_DBLUE, "Спасибо что доложили о преступлении.");
                            
    SendClientMessage(playerid, COLOR_GRAD2, "*** Звонок закончен ***");
                            
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                            
    Mobile[playerid] = 255;
                            return 
    0;
                        }
                        if (
    badguy == playerid)
                        {
                            
    SendClientMessage(playerid, COLOR_DBLUE, "PHQ: Если вы шутите, то зря...Это экстренная линия.");
                            
    SendClientMessage(playerid, COLOR_GRAD2, "*** Звонок закончен ***");
                            
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                            
    Mobile[playerid] = 255;
                            return 
    0;
                        }
                        
    SendClientMessage(playerid, COLOR_DBLUE, "Диспетчер: 'Все посты были предупреждены.'");
                        
    SendClientMessage(playerid, COLOR_DBLUE, "Спасибо что доложили о преступлении.");
                        
    SetPlayerCriminal(badguy,playerid, PlayerCrime[playerid][pAccusing]);
                        if(
    WantedPoints[badguy] > 0) { } else { WantedPoints[badguy] += 2; }
                        
    SendClientMessage(playerid, COLOR_GRAD2, "*** Звонок закончен ***");
                        
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                        
    Mobile[playerid] = 255;
                        return 
    0;
                    }
    //invalid id
                    
    return 0;
                }
    //not connected
                
    else
                {
                    
    format(string, sizeof(string), "PHQ: y нac нeт uнфopmaцuu o %s, вы yвepeны в npaвиuльнocтu umeнu?",tmp);
                    
    SendClientMessage(playerid, COLOR_DBLUE, string);
                    return 
    0;
                }
            }
            if(
    Mobile[playerid] == 912)
            {
                if(!
    strlen(tmp))
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "911: 'Извините, вас плохо слышно...'");
                    return 
    0;
                }
                
    strmid(PlayerCrime[playerid][pAccusing], text, 0, strlen(text), 255);
                
    SendClientMessage(playerid, COLOR_DBLUE, "PHQ: Если вам известно имя налетчика, то сообщите его, если нет, то просто скажите 'нет'.");
                
    Mobile[playerid] = 913;
                return 
    0;
            }
            if(
    Mobile[playerid] == 911)
            {
                if(!
    strlen(tmp))
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "911: 'Повторите еще раз, пожалуйста. Полиция (02) или скорая помощь (03)?'");
                    return 
    0;
                }
                else if ((
    strcmp("02", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("02")))
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "911: Соединяю вас с диспетчером полиции. Пожалуйста, подождите...");
                    
    Mobile[playerid] = 912;
                    
    SendClientMessage(playerid, COLOR_DBLUE, "PHQ: Это Диспетчер SAPD, пожалуйста дайте короткое описание преступления.Сообщите место происшествия.");
                    return 
    0;
                }
                else if ((
    strcmp("03", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("03")))
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "911: Соединяю вас с диспетчером скорой помощи. Пожалуйста, подождите...");
                    
    Mobile[playerid] = 914;
                    
    SendClientMessage(playerid, TEAM_CYAN_COLOR, "Диспетчер: Здравствуйте, коротко сообщите о случившемся.Сообщите место происшествия.");
                    return 
    0;
                }
                else
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "911: Извините, но вас плохо слышно, полиция (02) или скорая помощь (03)?");
                    return 
    0;
                }
            }
            if(
    IsPlayerConnected(Mobile[playerid]))
            {
                if(
    Mobile[Mobile[playerid]] == playerid)
                {
                    if(
    PlayerInfo[playerid][pHideNumber] == 0 && !IsAtPayphone(playerid))
                    {
                           if(
    PlayerInfo[playerid][pMask] == 1)
                        {
                           
    format(string, sizeof(string), "Незнакомец гoвopuт (в тeл.): %s", text);
                        }
                        else
                        {
                            
    format(string, sizeof(string), "%s гoвopuт (в тeл.): %s", sendername, text);
                        }
                     }
                    else
                    {
                        
    format(string, sizeof(string), "Незнакомый голос (в тeл.): %s",text);
                    }
                    
    SendClientMessage(Mobile[playerid], COLOR_YELLOW2,string);
                }
            }
            else
            {
                
    SendClientMessage(playerid, COLOR_YELLOW,"Кроме вас здесь никого нет!");
            }
            return 
    0;
        }
      }
    в public OnGameModeInit() вставляем
    PHP:
    //================================[ Таксофоны ]===========================================//
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1721.1951,-1721.3274,13.5454,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1805.8915,-1600.8894,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1806.7111,-1599.9607,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1807.6871,-1599.1393,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1808.6970,-1598.2676,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1809.6656,-1597.4368,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1710.4701,-1604.8776,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1710.4701,-1604.8776,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1711.3196,-1605.5674,13.5469,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,295.0905,-1573.5332,33.4427,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,296.7084,-1573.7710,33.4631,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,296.7084,-1573.7710,33.4631,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,303.1015,-1592.8331,32.8495,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,302.1358,-1592.7343,32.8115,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,279.6747,-1630.7975,33.3107,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,278.0888,-1630.6023,33.3104,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,2257.7419,-1211.6727,23.9688,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,2259.2512,-1211.6838,23.9688,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1721.2006,-1720.4731,13.5416,40.0,0,1);
            
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1723.0820,-1721.2474,13.5468,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,1723.0801,-1720.3872,13.5394,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,356.8147,-1364.4952,14.4850,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,355.3643,-1365.1548,14.4661,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,338.8322,-1397.2825,14.2228,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,339.9358,-1397.6555,14.3896,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,339.5755,-1398.7756,14.3890,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,338.3472,-1398.7109,14.3734,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,523.1959,-1526.4417,14.8026,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,522.3254,-1525.6119,14.7490,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,523.1973,-1524.7677,14.6949,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,523.9938,-1525.6340,14.7482,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,523.1372,-1517.2546,14.6006,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,522.3214,-1516.3606,14.5958,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,523.1416,-1515.5714,14.5915,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,524.0108,-1516.4266,14.5961,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,2069.4102,-1767.8351,13.5622,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,2069.4695,-1766.6896,13.5627,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,-1967.3879,162.3943,27.6875,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,-1966.2800,162.3970,27.6875,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,-1965.1171,162.3969,27.6875,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,-1964.1456,162.3980,27.6875,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,2166.3914,-1155.7433,24.8626,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,2166.3933,-1154.9111,24.8758,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,378.6402,-1717.1147,23.4408,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,378.6397,-1717.9363,23.2052,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,383.2906,170.0077,1008.3828,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,381.6122,170.0071,1008.3828,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,381.6122,170.0071,1008.3828,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,379.8120,170.0071,1008.3828,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,638.0289,-1227.5535,18.1406,40.0,0,1);
        
    CreateDynamic3DTextLabel("/call [номер].",COLOR_LIME,638.0356,-1229.1333,18.0745,40.0,0,1);
    в public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    вставляем
    PHP:
    if(dialogid == 36)//Ввели номер телефона
        
    {
            if(
    response)
            {
                if(!
    strlen(inputtext))
                {
                    
    ShowPlayerDialog(playerid,36,DIALOG_STYLE_INPUT,"Куда звонить","Введи номер телефона","Ок","Отменить");
                    return 
    1;
                }
                new 
    phonenumb = strval(inputtext);
                if(
    hMobile[playerid] != 0)
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "Вы уже звоните!");
                    return 
    1;
                }
                
    GetPlayerName(playerid, sendername, sizeof(sendername));
                
    format(string, sizeof(string), "* %s нaбupaeт нoмep на домашнем телефоне.", sendername);
                
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
    SetPlayerSpecialAction ( playerid , SPECIAL_ACTION_USECELLPHONE );
                if(
    phonenumb == 911)
                {
                    
    SendClientMessage(playerid, COLOR_ALLDEPT, "ДИСПЕТЧЕР: Кого вы хотите вызвать? полицию (02) или медика (03) ");
                    
    Mobile[playerid] = 911;
                    return 
    1;
                }
                if(
    phonenumb == PlayerInfo[playerid][pPnumber])
                {
                    
    SendClientMessage(playerid, COLOR_GRAD2, "** Абонент занят **");
                    
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                    return 
    1;
                }
                new 
    giveplayerid;
                for(new 
    i = 0; i < MAX_PLAYERS; i++)
                {
                    if(
    IsPlayerConnected(i))
                    {
                        if(
    PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
                        {
                            
    giveplayerid = i;
                            
    Mobile[playerid] = giveplayerid; //caller connecting
                            
    if(IsPlayerConnected(giveplayerid))
                            {
                                if(
    giveplayerid != INVALID_PLAYER_ID)
                                {
                                    if(
    PhoneOnline[giveplayerid] > 0)
                                    {
                                        
    SendClientMessage(playerid, COLOR_GREY, "** Абонент недоступен **");
                                        
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                                        return 
    1;
                                    }
                                    if(
    PlayerInfo[giveplayerid][pJailed] > 0)
                                    {
                                        
    SendClientMessage(playerid, COLOR_GREY, "** Абонент недоступен **");
                                        
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);
                                        return 
    1;
                                    }
                                    if (
    Mobile[giveplayerid] == 255)
                                    {
                                        if(
    IsAtPayphone(playerid)) format(string, sizeof(string), " Ваш телефон зазвонил, введите (/Pickup) Вызывает: Неизвестный входящий"); //modif
                                        
    else format(string, sizeof(string), " Ваш телефон зазвонил, введите (/Pickup) Вызывает: %d", PlayerInfo[playerid][pPnumber]); //modif
                                    //    format(string, sizeof(string), "Baш мoбuльнuk звoнuт. Aбoнeнт: %s", sendername);
                                        
    SendClientMessage(giveplayerid, COLOR_YELLOW2, string);
                                        
    GetPlayerName(giveplayerid, sendername, sizeof(sendername));
                                        
    RingTone[giveplayerid] = 10;
                                        
    format(string, sizeof(string), "** У %s звонит телефон.", sendername);
                                        
    ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        
    CellTime[playerid] = 1;
                                        if(
    IsAtPayphone(playerid))
                                        {
                                            
    Payphone[playerid]=1;
                                            
    TogglePlayerControllable(playerid,0);
                                        }
                                        return 
    1;
                                    }
                                }
                            }
                        }
                    }
                }
                
    SendClientMessage(playerid, COLOR_GRAD2, "** Абонент занят **");
                
    SetTimerEx("HidePhone",2000,0,"i",Float:playerid);

            }
            return 
    1;
        }
    и
    PHP:
     if(dialogid == 5)
        {
            if(
    response)
            {
                if(!
    strlen(inputtext))
                {
                    
    ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Пополнение счета","Введите сумму которую хотите положить на счет мобильного","Ок","Отмена");
                }
                new 
    mobakk = strval(inputtext);
                if(
    mobakk < 1 || mobakk > 100) { SendClientMessage(playerid, COLOR_GREY, "Сумма платежа должна составлять не менее1$ и не более 100$!"); return 1; }
                new 
    lastakk = PlayerInfo[playerid][pTA];
                if(
    lastakk >= 100) { SendClientMessage(playerid, COLOR_GREY, "На вашем лицевом счете уже достаточно денег!"); return 1; }
                if(
    PlayerInfo[playerid][pCash] < mobakk)
                {
                    
    SendClientMessage(playerid,COLOR_GREY," У тебя нет такой суммы!");
                    
    ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"{ff0000}Пополнение счета","Введите сумму которую хотите положить на счет мобильного","Ок","Отмена");
                    return 
    1;
                }
                
    ServerGivePlayerMoney(playerid, -mobakk);
                
    PlayerInfo[playerid][pTA] += mobakk;
                new 
    newakk = PlayerInfo[playerid][pTA];
                
    SendClientMessage(playerid, COLOR_GREY, "=========[ Чек ]=========");
                
    format(string, sizeof(string), "* Старый баланс %d $", lastakk);
                
    SendClientMessage(playerid, COLOR_GREY, string);
                
    format(string, sizeof(string), "* Вы пополнили на %d $", mobakk);
                
    SendClientMessage(playerid, COLOR_GREY, string);
                
    format(string, sizeof(string), "* Новый баланс%d $", newakk);
                
    SendClientMessage(playerid, COLOR_GREY, string);
                
    SendClientMessage(playerid, COLOR_GREY, "=======================");
            }
        }
     
  2. baursak007

    YouHack Forever
    baursak007

    Статус:
    Оффлайн
    Регистрация:
    14.10.12
    Сообщения:
    567
    Репутация:
    365 +/-
    +1
     
  3. Stive-O

    ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
    Stive-O

    Статус:
    Оффлайн
    Регистрация:
    22.07.12
    Сообщения:
    2.743
    Репутация:
    7.000 +/-
    И кому это надо?
     
  4. Bapxammer

    Bapxammer

    Статус:
    Оффлайн
    Регистрация:
    17.12.12
    Сообщения:
    23
    Репутация:
    16 +/-
    Владельцам серверов samp
     
  5. Putnik

    Putnik

    Статус:
    Оффлайн
    Регистрация:
    12.06.12
    Сообщения:
    471
    Репутация:
    418 +/-
    Поддержу.
     
  6. RoVeR

    RoVeR

    Статус:
    Оффлайн
    Регистрация:
    31.05.11
    Сообщения:
    444
    Репутация:
    127 +/-
    Сказали же, для владельцев серверов samp
     
  7. myasko

    myasko

    Статус:
    Оффлайн
    Регистрация:
    04.12.12
    Сообщения:
    271
    Репутация:
    143 +/-
    Спасибо, помог)
     
  8. F1ReF0X

    F1ReF0X

    Статус:
    Оффлайн
    Регистрация:
    18.11.12
    Сообщения:
    3.181
    Репутация:
    1.301 +/-
    Здесь владельцев серверов samp почти нет)
     
  9. (ViktoR)

    (ViktoR)

    Статус:
    Оффлайн
    Регистрация:
    09.01.13
    Сообщения:
    104
    Репутация:
    67 +/-
    спасибо:ok: