/getgun (Для мафий) Samp-rp (/getgun [id]) - Форум Cheat-Master.ru
  • Страница 1 из 1
  • 1
Модератор форума: [CM]OlegEhtler, Getbackthere, Phoenixxx_Czar  
/getgun (Для мафий) Samp-rp (/getgun [id])
Сrazy™ Дата: Вторник, 17.06.2014, 21:03 | Сообщение # 1
Боец
Сообщений: 267
Статус: Offline
1( Добовляем ко всем "new"

Код
new GetGun[MAX_PLAYERS];  


2* Добовляем в "OnPlayerConnect"

Код
GetGun[playerid] = playerid;  


3* Добовляем в команды
Код
if(strcmp(cmd, "/getgun", true) == 0)
       {
           tmp = strtok(cmdtext, idx);
           giveplayerid = ReturnUser(tmp);
           if(!strlen(tmp)) SendClientMessage(playerid, COLOR_WHITE, "Вы можете использовать {33AA33}/getgun [id игрока]{FFFFFF}, чтобы выдать оружие другим членам организации");
           else
           {
               if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Игрок не найден!");
               GetGun[playerid] = giveplayerid;
           }
           if(PlayerInfo[playerid][pRank] < 4)return SendClientMessage(playerid, COLOR_GREY, "Оружие можно взять с 4 ранга");
           if(!PlayerToPoint(5.0,playerid,1258.4004,-791.0316,1084.0078)) return SendClientMessage(playerid, COLOR_GREY, "Вы не в том месте!");
           new listitems[] = "[1] Desert Eagle\t[70 материалов/50 патронов]\n[2] Shotgun\t\t[50 материалов/15 патронов]\n[3] Rifle\t\t\t[100 материалов/10 патронов]\n[4] M4\t\t\t[500 материалов/100 патронов]\n[5] AK-47\t\t[500 материалов/100 патронов]\n[6] MP5\t\t\t[400 материалов/200 патронов]\n[7] SDPistol\t\t[100 материалов/100 патронов])";
           switch(PlayerInfo[playerid][pMember])
           {
               case 5: ShowPlayerDialog(playerid, 2014, DIALOG_STYLE_LIST, "Склад оружия", listitems, "Выбрать", "Отмена");
               case 6: ShowPlayerDialog(playerid, 2013, DIALOG_STYLE_LIST, "Склад оружия", listitems, "Выбрать", "Отмена");
               case 14: ShowPlayerDialog(playerid, 2015, DIALOG_STYLE_LIST, "Склад оружия", listitems, "Выбрать", "Отмена");
           }
           return 1;
       }     


4* Добовляем в диалоги

Код
case 2014:
           {
               if(response)
               {
                 switch(listitem)
                   {
                       case 0:
                       {
                           if(lcnmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                           gun = 24; ammo = 50; lcnmats -= 70;
                       }
                       case 1:
                       {
                           if(lcnmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                           gun = 25; ammo = 15; lcnmats -= 50;
                       }
                       case 2:
                       {
                           if(lcnmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                           gun = 33; ammo = 10; lcnmats -= 100;
                       }
                       case 3:
                         {
                           if(lcnmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                           gun = 31; ammo = 100; lcnmats -= 500;
                       }
                       case 4:
                       {
                           if(lcnmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                           gun = 30; ammo = 100; lcnmats -= 500;
                       }
                       case 5:
                       {
                           if(lcnmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                           gun = 29; ammo = 200; lcnmats -= 400;
                       }
                          case 6:
                       {
                           if(lcnmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                           gun = 23; ammo = 100; lcnmats -= 100;
                       }
                   }
                 new sendername[MAX_PLAYER_NAME];
                 new giveplayer[MAX_PLAYER_NAME];
                 GetWeaponName(gun, gunname, sizeof(gunname));
                 GiveWeapon(GetGun[playerid], gun, ammo);
                 format(string, 256, "Вы взяли оружие со склада");
                 SendClientMessage(playerid, 0x6495EDFF, string);
                 GetPlayerName(playerid,sendername,sizeof(sendername));
                 GetPlayerName(GetGun[playerid],giveplayer,sizeof(giveplayer));
                 if(GetGun[playerid] == playerid)
                 {
                     format(string, sizeof(string), "%s взял(а) оружие со склада", sendername);
                      ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                 }
                 else
                 {
                     GetGun[playerid] = playerid;
                     format(string, sizeof(string), "%s взял(а) оружие со склада и передал(а) %s", sendername,giveplayer);
                      ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                 }
                   SaveMaterials();
                   return 1;
                 }
                else
               {
                   return 1;
               }
           }

           case 2015:
           {
               if(response)
               {
                 switch(listitem)
                   {
                   case 0:
                   {
                       if(rmmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 24; ammo = 50; rmmats -= 70;
                   }
                   case 1:
                   {
                       if(rmmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 25; ammo = 15; rmmats -= 50;
                   }
                   case 2:
                   {
                       if(rmmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 33; ammo = 10; rmmats -= 100;
                   }
                   case 3:
                   {
                       if(rmmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 31; ammo = 100; rmmats -= 500;
                   }
                   case 4:
                   {
                       if(rmmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 30; ammo = 100; rmmats -= 500;
                   }
                   case 5:
                   {
                       if(rmmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 29; ammo = 200; rmmats -= 400;
                   }
                      case 6:
                   {
                       if(rmmats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 23; ammo = 100; rmmats -= 100;
                   }
                   }
                 new sendername[MAX_PLAYER_NAME];
                 new giveplayer[MAX_PLAYER_NAME];
                 GetWeaponName(gun, gunname, sizeof(gunname));
                 format(string, 256, "Вы взяли оружие со склада");
                 SendClientMessage(playerid, 0x6495EDFF, string);
                 GetPlayerName(playerid,sendername,sizeof(sendername));
                 GetPlayerName(GetGun[playerid],giveplayer,sizeof(giveplayer));
                 GiveWeapon(GetGun[playerid], gun, ammo);
                 if(GetGun[playerid] == playerid)
                 {
                     format(string, sizeof(string), "%s взял(а) оружие со склада", sendername);
                      ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                 }
                 else
                 {
                     GetGun[playerid] = playerid;
                     format(string, sizeof(string), "%s взял(а) оружие со склада и передал(а) %s", sendername,giveplayer);
                      ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                 }
                   SaveMaterials();
                   return 1;
                }
                else
               {
                   return 1;
               }
           }
           case 2013:
           {
               if(response)
               {
                 switch(listitem)
                 {
                   case 0:
                   {
                       if(yakuzamats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 24; ammo = 50;
                       yakuzamats -= 70;
                   }
                   case 1:
                   {
                       if(yakuzamats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 25; ammo = 15;
                       yakuzamats -= 50;
                   }
                   case 2:
                   {
                       if(yakuzamats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 33; ammo = 10;
                       yakuzamats -= 100;
                   }
                   case 3:
                   {
                       if(yakuzamats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 31; ammo = 100;
                       yakuzamats -= 500;
                   }
                   case 4:
                   {
                       if(yakuzamats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 30; ammo = 100;
                       yakuzamats -= 500;
                   }
                   case 5:
                   {
                       if(yakuzamats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 29; ammo = 200;
                       yakuzamats -= 400;
                   }
                      case 6:
                   {
                       if(yakuzamats <= 50) return SendClientMessage(playerid, COLOR_GREY, "На складе нет материалов!");
                       gun = 23; ammo = 100; yakuzamats -= 100;
                   }
                 }
                 new sendername[MAX_PLAYER_NAME];
                 new giveplayer[MAX_PLAYER_NAME];
                 GetWeaponName(gun, gunname, sizeof(gunname));
                 GiveWeapon(GetGun[playerid], gun, ammo);
                 format(string, 256, "Вы взяли оружие со склада");
                 SendClientMessage(playerid, 0x6495EDFF, string);
                 GetPlayerName(playerid,sendername,sizeof(sendername));
                 GetPlayerName(GetGun[playerid],giveplayer,sizeof(giveplayer));
                 if(GetGun[playerid] == playerid)
                 {
                     format(string, sizeof(string), "%s взял(а) оружие со склада", sendername);
                      ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                 }
                 else
                 {
                     GetGun[playerid] = playerid;
                     format(string, sizeof(string), "%s взял(а) оружие со склада и передал(а) %s", sendername,giveplayer);
                      ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                 }
                  SaveMaterials();
                  return 1;
                }
                else
               {
                   return 1;
               }
           }  


Автор: Автор RiverFuler :P


Сообщение отредактировал Сrazy™ - Вторник, 17.06.2014, 21:03
  • Страница 1 из 1
  • 1
Поиск: