• Страница 1 из 1
  • 1
Форум » PAWNO » Уроки Pawno » [Мануал] Сис-ма рыбалки. (mxINI)
[Мануал] Сис-ма рыбалки. (mxINI)
Дмитрий Дата: Четверг, 09.01.2014, 12:53 | Сообщение # 1 | Сообщить о нерабочей теме


Аватар для Дмитрий

Здраствуйте увж. пользователи, вот написал сис-му рыбалки с 0 для мода на mxINI решил поделится с вами.

Вот суть рыбалки: Вы идёте в магазин покупаете удочку и наживку, так как без удочки вы не сможете ловить рыбу да и без наживки тоже, как только вы прописали /fish то есть начали ловить рыбу, у вас станет на 1 наживку меньше даже если вы словите или нет рыбу. Удочка у вас остается всегда. Дальше вы идете к корабликам садитесь и арендуете кораблик(бага с арендой нет) и едете к указанному вам чекпоинту (рандом) после того как вы приехали ловите рыбу командой /fish если словили тогда вам дадут +1 рыбу и -1 наживки, а рыбу вы сможете съесть и вам даст +20хп, но если у вас больше 90хп вам ничего не даст вы просто не сможете съесть рыбу, но если вы не словили рыбу то вам даст +0 рыбы biggrin и конечно же -1 наживка.

[admin]Автор системы: BlackWolf4278[/admin]

[spoiler="Скрины"]




[/spoiler]

Сам мануал:

Цитата
Ко всем new:

Код
new fishingshop1, fishingshop2;


В паблик OnPlayerPickUpPickup:
Код
else if(pickupid == fishingshop1) //Óëèöà
      {

          SetPlayerInterior(playerid, 0);
          SetPPos(playerid,356.1742,-2074.2048,10.2663);
          SetPlayerFacingAngle(playerid, 180.7410);
      }
      else if(pickupid == fishingshop2) //Èíò

      {

          SetPlayerInterior(playerid, 6);
          SetPPos(playerid,-2237.8811,136.8535,1035.4141);
          SetPlayerFacingAngle(playerid, 92.4441);
      }  


Цитата
В паблик OnGameModeInit:

Код
fishingshop1 = CreatePickup(19197,23,-2240.6428,137.1731,1035.4141); // на улицу
fishingshop2 = CreatePickup(19197,23,356.0586,-2071.4338,10.6953); // в инт  


Цитата
Ко всем new:

Код
new fishingboat[5];


Цитата
В паблик OnPlayerStateChange:

Код
if(newcar >= fishingboat[0] && newcar <= fishingboat[4])
          {
           if(PlayerInfo[playerid][pYdochka] == 1)
              {
                 if(GetPlayerVehicleID(playerid) != GetPVarInt(playerid,"ArendaCar"))
                 {
                      ShowPlayerDialog(playerid,9127,DIALOG_STYLE_MSGBOX, "Аренда кора***", "Вы хотите арендовать корабль для рыбалки за 1000 вирт?", "Снять", "Отмена");
                      TogglePlayerControllable(playerid, 0);
                  }
              }
              else
              {
                  SendClientMessage(playerid, COLOR_GREY, "У вас нет удочки. Купите тогда приходите опять.");
                  RemoveVehicle(playerid);
              }
          }  


Цитата
В паблик CreateVehicles:

Код
//---------------------------------[ boats ]-----------------------------------------
      fishingboat[0] = AddStaticVehicleEx(453,404.4855,-2102.2783,-0.5115,268.5013,1,1,1550); // boat 1
          fishingboat[1] = AddStaticVehicleEx(453,390.1325,-2102.1594,-0.1642,269.2771,1,1,1550); // boat 2
      fishingboat[2] = AddStaticVehicleEx(453,376.2626,-2102.7754,-0.2722,268.2941,1,1,1550); // boat 3
      fishingboat[3] = AddStaticVehicleEx(453,364.8602,-2102.7263,-0.1090,267.3876,1,1,1550); // boat 4
      fishingboat[4] = AddStaticVehicleEx(453,346.3792,-2100.5354,-0.5108,177.9939,1,1,1550); // boat 5


Цитата
Ко всем case:

Код
  case 9127:
          {
              if(response)
              {
                  if(PlayerInfo[playerid][pCash] <= 1000)
                  {
                      SendClientMessage(playerid, COLOR_GREY, "Недостаточно денег");
                      RemoveVehicle(playerid);
                      TogglePlayerControllable(playerid, 1);
                      return true;
                  }
                  PlayerInfo[playerid][pCash] -= 1000;
                  SetPVarInt(playerid,"ArendaCar", GetPlayerVehicleID(playerid));
                  TogglePlayerControllable(playerid, 1);
                  format(string, sizeof(string), "~w~YOU HAVE HIRED A BOAT~n~GOD LUCK ON FISHING");
                  GameTextForPlayer(playerid, string, 5000, 3);
                  FishPlace(playerid);
                  SendClientMessage(playerid, COLOR_GREEN, "Вы арендовали корабль");
                  SendClientMessage(playerid, COLOR_GREEN, "Ваш квадрат ловли рыбы отмечен на карте.");
                  return true;
              }
              else
              {
                  RemoveVehicle(playerid);
                  TogglePlayerControllable(playerid, 1);
                  return true;
              }
          }


Цитата
В конец мода:

Код
stock FishPlace(playerid)
{ switch(random(5))// данное число должно равняться последнему case.
         { case 0: SetPlayerCheckpoint(playerid,510.0920,-2339.9844,1.0611,6); case 1: SetPlayerCheckpoint(playerid,385.6881,-2423.7810,0.5722,6);
           case 2: SetPlayerCheckpoint(playerid,301.6492,-2331.4458,0.4600,6); case 3: SetPlayerCheckpoint(playerid,198.0347,-2219.9585,0.7775,6); case 4: SetPlayerCheckpoint(playerid,119.0307,-2321.1106,1.0210,6); } }  


Цитата
В паблик OnPlayerConnect:

Код
////////////////////////fishing//////////////////////
      RemoveBuildingForPlayer(playerid, 1280, 378.84305, -2083.22949, 7.23096, 0.25);
      RemoveBuildingForPlayer(playerid, 1280, 369.25702, -2083.0686, 7.45957, 0.25);
      RemoveBuildingForPlayer(playerid, 1280, 390.50394, -2083.11499, 7.23096, 0.25);
      RemoveBuildingForPlayer(playerid, 1215, 379.80112, -2087.10156, 7.50588, 0.25);
      RemoveBuildingForPlayer(playerid, 1215, 380.8143, -2071.01855, 7.28761, 0.25);
      RemoveBuildingForPlayer(playerid, 1215, 386.54303, -2062.17212, 7.01966, 0.25);
      RemoveBuildingForPlayer(playerid, 1215, 379.63293, -2055.36084, 7.22506, 0.25);
      RemoveBuildingForPlayer(playerid, 1215, 386.48962, -2049.55469, 7.31517, 0.25);
      RemoveBuildingForPlayer(playerid, 6466, 374.69531, -2054.88281, 8.70313, 0.25);  


Цитата
В паблик CreateObjects:

Код
////////////////Fishing////////////////
      CreateObject(3406, 406.29999, -2098.5, 0, 0, 0, 0); // ?????? 0
CreateObject(3406, 397.70001, -2098.5, 0, 0, 0, 0); // ?????? 1
CreateObject(3406, 389.10001, -2098.5, 0, 0, 0, 0); // ?????? 2
CreateObject(3406, 380.39999, -2098.5, 0, 0, 0, 0); // ?????? 3
CreateObject(3406, 371.70001, -2098.5, 0, 0, 0, 0); // ?????? 4
CreateObject(3406, 363, -2098.5, 0, 0, 0, 0); // ?????? 5
CreateObject(3406, 354.20001, -2098.5, 0, 0, 0, 0); // ?????? 6
CreateObject(982, 414.91797, -2061.05762, -28.16223, 0, 0, 0); // ?????? 7
CreateObject(982, 362.10001, -2097.80005, 2.8, 0, 0, 270); // ?????? 8
CreateObject(982, 397.39999, -2097.80005, 2.8, 0, 0, 270); // ?????? 9
CreateObject(983, 377.89999, -2097.80005, 2.8, 0, 0, 270); // ?????? 10
CreateObject(10244, 382.10001, -2091.80005, 3.3, 0, 0, 90); // ?????? 11
CreateObject(1624, 383.29999, -2097.69995, 1.42, 0, 0, 272); // ?????? 12
CreateObject(1624, 381.79999, -2097.69995, 1.42, 0, 0, 268); // ?????? 13
CreateObject(982, 362.39999, -2089.19995, 7.5, 0, 0, 90); // ?????? 14
CreateObject(982, 397.10001, -2089.1001, 7.5, 0, 0, 270); // ?????? 15
CreateObject(983, 376.60001, -2089.19995, 7.5, 0, 0, 270); // ?????? 16
CreateObject(1215, 378.89999, -2057, 7.4, 0, 0, 0); // ?????? 17
CreateObject(1215, 381.89999, -2057, 7.4, 0, 0, 0); // ?????? 18
CreateObject(1215, 383.5, -2057.1001, 7.4, 0, 0, 0); // ?????? 19
CreateObject(1215, 385.10001, -2057, 7.4, 0, 0, 0); // ?????? 20
CreateObject(1215, 386.5, -2057, 7.4, 0, 0, 0); // ?????? 21
CreateObject(1215, 380.39999, -2057, 7.4, 0, 0, 0); // ?????? 22
CreateObject(1215, 387.79999, -2057, 7.4, 0, 0, 0); // ?????? 23
CreateObject(1215, 389.20001, -2057, 7.4, 0, 0, 0); // ?????? 24
CreateObject(1215, 390.60001, -2057, 7.4, 0, 0, 0); // ?????? 25
CreateObject(1215, 391.89999, -2057, 7.4, 0, 0, 0); // ?????? 26
CreateObject(1215, 393.10001, -2058, 7.4, 0, 0, 0); // ?????? 27
CreateObject(1215, 393.70001, -2059.19995, 7.4, 0, 0, 0); // ?????? 28
CreateObject(1215, 355.79999, -2049.6001, 7.4, 0, 0, 0); // ?????? 29
CreateObject(1215, 355.79999, -2048.5, 7.4, 0, 0, 0); // ?????? 30
CreateObject(1215, 355.79999, -2047.40002, 7.4, 0, 0, 0); // ?????? 31
CreateObject(1215, 398.89999, -2047.09998, 7.4, 0, 0, 0); // ?????? 32
CreateObject(1215, 398.29999, -2047.59998, 7.4, 0, 0, 0); // ?????? 33
CreateObject(1215, 398.29999, -2048.3999, 7.4, 0, 0, 0); // ?????? 34
CreateObject(1215, 398.29999, -2049.30005, 7.4, 0, 0, 0); // ?????? 35
CreateObject(2946, 355.20001, -2070.62012, 9.7, 0, 0, 270); // ?????? 36  


Цитата
В паблик OnPlayerCommandText:

Код
if(strcmp("/fish", cmdtext, true, 10) == 0)
      {
           if(VaildFishPlace(playerid) && !IsPlayerInAnyVehicle(playerid))
          {
              if(PlayerInfo[playerid][pYdochka] == 0) return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} У вас нету удочки");
              if(PlayerInfo[playerid][pNaguvka] == 0) return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} У вас нет наживки");
              if(GetPVarInt(playerid, "Fishing") > 0) return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Вы уже рыбачите");
               TogglePlayerControllable(playerid, 0);
              ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,0,1,1);
              new randfish = 10 + random(19);
              SetPVarInt(playerid, "FishingTime", randfish);
              GameTextForPlayer(playerid,"~g~Waiting....", randfish*1000, 6);
              PlayerInfo[playerid][pNaguvka] -= 1;
              new object = SetPlayerAttachedObject(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
              SetPVarInt(playerid, "FishingObject", object);
              SetPVarInt(playerid, "Fishing", 1);
          }
          else SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Вы должны находится в своем квадрате!");
          return 1;
      }
      else if(strcmp(cmd, "/fbuy", true) == 0)
      {
          if(IsPlayerConnected(playerid))
          {
                  if (PlayerToPoint(5, playerid,-2237.1477,130.3749,1035.4141))
                  {
                      ShowPlayerDialog(playerid, 7792, DIALOG_STYLE_LIST, "Рыбалка","1. Удочка [5000 вирт]\n2. Наживка [100 вирт]", "Купить", "Отмена");
                  }
          }
          return true;
      }
      else if(strcmp(cmd, "/eatfish", true) == 0)
      {
          if(PlayerInfo[playerid][Сюда переменную вашего HP] < 90)
          {
                      if(PlayerInfo[playerid][pRuba] < 1) return SendClientMessage(playerid, COLOR_WHITE, "{8080ff}Недостаточно рыбы.");
                      new Float:health;
                      GetPlayerHealth(playerid,health);
                      SetPlayerHealthAC(playerid, health + 20.0);
                      PlayerInfo[playerid][Сюда переменную вашего HP] += 20;
                      PlayerInfo[playerid][pRuba] -= 1;
                       SendMes(playerid, COLOR_GREEN, "Вы съели 1 рыбу, вам добавилось 20 хп.");
          }
          else
              {
                  SendClientMessage(playerid, COLOR_RED, "Вы здоровы и не нуждаетесь в рыбе");
              }
          return true;
      }  


Цитата
В команде /eatfish измените:

Код

PlayerInfo[playerid][Сюда переменную вашего HP] += 20;    
и
if(PlayerInfo[playerid][Сюда переменную вашего HP] < 90)

так как у вас тут (pHP) считало что это BB код ))  
Прикрепления: 2600192.jpg (80.3 Kb) · 5719994.jpg (75.7 Kb) · 9593478.jpg (43.6 Kb) · 7142015.jpg (45.2 Kb)


From Russia With Love!
Дмитрий Дата: Четверг, 09.01.2014, 12:54 | Сообщение # 2 | Сообщить о нерабочей теме


Аватар для Дмитрий

Цитата
В паблик Fresh:

Код
//---------------------fishing
         if(GetPVarInt(i, "FishingTime") > 0 && GetPVarInt(i, "Fishing") > 0)
         {
             SetPVarInt(i, "FishingTime", GetPVarInt(i, "FishingTime") - 1);
             if(GetPVarInt(i, "FishingTime") == 0)
             {
                 new fish = random(10);
                 if(fish == 0) SendClientMessage(i, COLOR_BLUE, "Вы ничего не поймали. Попробуйте еще раз");
                 else if(fish == 1) { SendClientMessage(i, COLOR_WHITE, "Поздоровляем! Вы поймали рыбу. Теперь вы можите сёсть её. Используйте: /eatfish"); PlayerInfo[i][pRuba] += 1; }
                 else if(fish == 2) SendClientMessage(i, COLOR_BLUE, "Вы ничего не поймали. Попробуйте еще раз");
                 else if(fish == 3) { SendClientMessage(i, COLOR_WHITE, "Поздоровляем! Вы поймали рыбу. Теперь вы можите сёсть её. Используйте: /eatfish"); PlayerInfo[i][pRuba] += 1; }
                 else if(fish == 4) SendClientMessage(i, COLOR_BLUE, "Вы ничего не поймали. Попробуйте еще раз");
                 else if(fish == 5) { SendClientMessage(i, COLOR_WHITE, "Поздоровляем! Вы поймали рыбу. Теперь вы можите сёсть её. Используйте: /eatfish"); PlayerInfo[i][pRuba] += 1; }
                 else if(fish == 6) SendClientMessage(i, COLOR_BLUE, "Вы ничего не поймали. Попробуйте еще раз");
                 else if(fish == 7) { SendClientMessage(i, COLOR_WHITE, "Поздоровляем! Вы поймали рыбу. Теперь вы можите сёсть её. Используйте: /eatfish"); PlayerInfo[i][pRuba] += 1; }
                 else if(fish == 8) SendClientMessage(i, COLOR_BLUE, "Вы ничего не поймали. Попробуйте еще раз");
                 else if(fish == 9) { SendClientMessage(i, COLOR_WHITE, "Поздоровляем! Вы поймали рыбу. Теперь вы можите сёсть её. Используйте: /eatfish"); PlayerInfo[i][pRuba] += 1; }
                 TogglePlayerControllable(i, 1);
                 ApplyAnimation(i,"CARRY","crry_prtial",4.0,0,0,0,0,0);
                 DeletePVar(i, "FishingTime");
                 DeletePVar(i, "Fishing");
                 RemovePlayerAttachedObject(i,0);
                 RemovePlayerAttachedObject(i,GetPVarInt(i, "FishingObject"));
                 DeletePVar(i, "FishingObject");
             }
         }  


Цитата
Ко всем case:

Код
case 7792:
         {
                 if(response)
                 {
                     if(listitem == 0)
                     {
                         if (PlayerToPoint(5, playerid,-2237.1477,130.3749,1035.4141))
                         {
                             if(PlayerInfo[playerid][pCash] < 5000) return SendClientMessage(playerid, COLOR_GREY, "Не достаточно денег");
                    if(PlayerInfo[playerid][pYdochka] > 1) return SendClientMessage(playerid, COLOR_GREY, "У вас уже есть удочка");
                             PlayerInfo[playerid][pCash] -=5000;
                             PlayerInfo[playerid][pYdochka] = 1;
                             SendClientMessage(playerid, 0x6495EDFF,"Вы купили удочку теперь можите рыбачить.");
                             return true;
                         }
                     }
                     else if(listitem == 1)////////////////////////////////////////////////////////////////
                     {
                         if(PlayerToPoint(5, playerid,-2237.1477,130.3749,1035.4141))
                         {
                             if(PlayerInfo[playerid][pCash] < 100) return SendClientMessage(playerid, COLOR_GREY, "Недостаточно денег");
                             PlayerInfo[playerid][pCash] -=100;
                             PlayerInfo[playerid][pNaguvka] += 10;
                             SendClientMessage(playerid, 0x6495EDFF,"Вы купили банку нажывки, теперь вы можите 10 раз закинуть удочку");
                             return true;
                         }
                     }
                 }
                 else
                 {
                     return true;
                 }
         }  


Цитата
К enum pInfo:

Код
pYdochka,pNaguvka  


Цитата
В паблик OnPlayerConnect:

Код
    PlayerInfo[playerid][pYdochka] = 0;
     PlayerInfo[playerid][pNaguvka] = 0;  


Цитата
В паблик OnPlayerRegister:

Код
ini_setInteger(File,"Ydochka",PlayerInfo[playerid][pYdochka]);
ini_setInteger(File,"Naguvka",PlayerInfo[playerid][pNaguvka]);  


Цитата
В паблик OnPlayerSave:

Код
ini_setInteger(File,"Ydochka",PlayerInfo[playerid][pYdochka]);
ini_setInteger(File,"Naguvka",PlayerInfo[playerid][pNaguvka]);


Цитата
В паблик OnPlayerLogin:

Код
ini_getInteger(File,"Ydochka",PlayerInfo[playerid][pYdochka]);
ini_getInteger(File,"Naguvka",PlayerInfo[playerid][pNaguvka]);


Ну вот и все.
Простите конечно код не супер, так как делал на скорую руку, но новичкам сойдет. И прошу прощения за что ль ужасный маппинг, маппер из меня никудышный biggrin


From Russia With Love!
Форум » PAWNO » Уроки Pawno » [Мануал] Сис-ма рыбалки. (mxINI)
  • Страница 1 из 1
  • 1
Поиск: