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

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

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

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

Система мини магазина.

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

Deda

Умник
Система мини магазина) (с объектами)
давно искал, и вот сам додумался и сделал)
работа моя.
для RLS
и так:
Магазин с покупкой объектов(объекты тоже мои)

в public OnPlayerCommandText(playerid, cmdtext[])

PHP:
if(strcmp(cmd, "/magazin", true) == 0)
    {
     if(IsPlayerConnected(playerid))
     {
         if(IsPlayerInRangeOfPoint(playerid,2.0,z,x,y))//(z,x,y, - координаты где вводить команду)
          {
               new listitems[] = "- Попугай\n- Комплект\n- Огонёк\n- Куриная шапка\n- Карта LS\n- Мигалка\n- Маска\n- Бандана №1\n- Бандана №2\n- Бандана №3\n- Бандана №4\n- Бандана №5\n- Маска дракона\n- Лазер\n- Яркий свет\n- Большой М4 в руку\n- Пенис\n- Костюм попугая\n- Шокер\n- Трость\n- Шляпа №1\n- Шляпа №2\n- НГ шапка\n- Шляпа №3\n- Кепка\n- Бронежилет\n- Маска №1\n- Маска №2\n- Маска №3\n- Зимняя шапка №1\n- Зимняя шапка №2\n- Зимняя шапка №3";
  			   ShowPlayerDialog(playerid, 1111, DIALOG_STYLE_LIST, "Магазин", listitems, "Купить", "Выход");
               return 1;
               }
           }
       }
в public OnGameModeInit()

PHP:
Create3DTextLabel("{ffffff}Введите:\n{ff0000}/magazin",COLOR_GREEN,z,x,y,10.0,0,1);//(z,x,y, - координаты где будет 3d текст)
в public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

PHP:
case 1111:
    {
     if(response)
     {
       if(listitem == 0)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)//Если у игрока меньше чем 10к, то ему пишет 'Не хватает денег'
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;//цена объекта денег(цены можете поменять на свои)
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);//выводит зеленый текст в середине экрана
       SetPlayerAttachedObject(playerid, 7, 19078, 1, 0.329150, -0.072101, 0.156082, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Попугая");
       return 1;
       }
       if(listitem == 1)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000);
       SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000);
       SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Комплект всемогущий");
       return 1;
       }
       if(listitem == 2)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 7, 19270, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Огонёк на голову");
       return 1;
       }
       if(listitem == 3)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2,19137,2,0.100000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Куриную шапку");
       return 1;
       }
       if(listitem == 4)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
       SetPlayerAttachedObject(playerid, 1 , 19167, 1,0.11,0.36,0.0,0.0,90.0);
       ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Карту LS");
       return 1;
       }
       if(listitem == 5)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 4, 18646, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Мигалку на голову");
       return 1;
       }
       if(listitem == 6)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 7, 19163, 2, 0.111052, 0.021643, -0.000846, 100.280899, 100.752510, 445.071044, 1.100000, 1.300000, 1.300000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Чёрную маску");
       return 1;
       }if(listitem == 7)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 18915, 2, 0.1, 0.03, -0.005, 90.0, 180.0, 90.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Бандану №1");
       return 1;
       }
       if(listitem == 8)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 18912, 2, 0.1, 0.03, -0.005, 90.0, 180.0, 90.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Бандану №2");
       return 1;
       }
           if(listitem == 9)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 18916, 2, 0.1, 0.03, -0.005, 90.0, 180.0, 90.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Бандану №3");
       return 1;
       }
     if(listitem == 10)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 18917, 2, 0.1, 0.03, -0.005, 90.0, 180.0, 90.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Бандану №4");
       return 1;
       }
       if(listitem == 11)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 18918, 2, 0.1, 0.03, -0.005, 90.0, 180.0, 90.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Бандану №5");
       return 1;
       }
       if(listitem == 12)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 4, 3528, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 0.100000, 0.100000, 0.100000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Маску дракона");
       return 1;
       }
       if(listitem == 13)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 4, 18643, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Лазер");
       return 1;
       }
       if(listitem == 14)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 7, 354, 1, 0.329150, -0.072101, 0.156082, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Яркий свет");
       return 1;
       }
       if(listitem == 15)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 1, 356, 6, 0.013610, -0.021393, -0.144862, 2.354303, 354.413848, 0.219168, 3.034477, 3.000000, 3.000000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Большой М4 в руку");
       return 1;
       }
       if(listitem == 16)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 1, 19086, 8, -0.049768, -0.014062, -0.108385, 87.458297, 263.478149, 184.123764, 0.622413, 1.041609, 1.012785);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Пенис");
       return 1;
       }
       if(listitem == 17)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 19078, 1, -1.097527, -0.348305, -0.008029, 0.000000, 0.000000, 0.000000, 8.073966, 8.073966, 8.073966);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Костюм попугая");
       return 1;
       }
       if(listitem == 18)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.055994, 0.018028, 0.045403, 348.699523, 154.366394, 0.000000, 1.000000, 1.000000, 1.000000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Шокер");
       return 1;
       }
       if(listitem == 19)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 0, 19348, 6, 0.055994, 0.018028, 0.045403, 348.699523, 154.366394, 0.000000, 1.000000, 1.000000, 1.000000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Трость");
       return 1;
       }
       if(listitem == 20)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 4, 19487, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Белую шляпу");
       return 1;
       }
       if(listitem == 21)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 4, 19352, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Чёрную шляпу");
       return 1;
       }
       if(listitem == 22)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2, 19066, 2, 0.13, 0.0, 0.0, 0.0, 80.0, 80.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Новогоднюю шапку");
       return 1;
    }
    if(listitem == 23)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 4, 19488, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Белую шляпу №2");
       return 1;
       }
    if(listitem == 24)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 3 , 18636, 2,0.131,0.045,0.00,0.0,90.0,96.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Кепку POLICE");
       return 1;
       }
    if(listitem == 25)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2 , 19142, 1,0.08,0.04,0.00,0.0,0.0,-7.4);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Бронежилет");
       return 1;
       }
    if(listitem == 26)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2 , 19036, 2,0.131,0.045,0.00,0.0,90.0,96.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Маску №1");
       return 1;
       }
    if(listitem == 27)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2 , 19037, 2,0.131,0.045,0.00,0.0,90.0,96.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Маску №2");
       return 1;
       }
    if(listitem == 28)
         {
         if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2 , 19038, 2,0.131,0.045,0.00,0.0,90.0,96.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Маску №3");
       return 1;
       }
    if(listitem == 29)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2, 19067, 2, 0.13, 0.0, 0.0, 0.0, 80.0, 80.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Зимнюю шапку №1");
       return 1;
    }
    if(listitem == 30)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2, 19068, 2, 0.13, 0.0, 0.0, 0.0, 80.0, 80.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Зимнюю шапку №2");
       return 1;
    }
    if(listitem == 31)
         {
                   if(PlayerInfo[playerid][pCash] < 10000)
          {
              SendClientMessage(playerid, COLOR_WHITE,"Не хватает денег.");
              return 1;
          }
       PlayerInfo[playerid][pCash] -= 10000;
       GameTextForPlayer(playerid,"~G~-10.000$",3000,5);
       SetPlayerAttachedObject(playerid, 2, 19069, 2, 0.13, 0.0, 0.0, 0.0, 80.0, 80.0);
       SendClientMessage(playerid, COLOR_BLUE, "{ffffff}Вы купили {00cc00}Зимнюю шапку №3");
       return 1;
    }
     }
     return 1;
    }
 
Последнее редактирование модератором:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу