Jump to content

Problema sistem trucker


kobra123

Recommended Posts

salut am si eu o problema la care ma chinui de vreo 2 zile deci am luat un sistem de trucking a mers totul k problema e ca am pus doar 2 curse in dialog si nush dc nu merge sa bag mai multe spre exemplu 4-5,si mai e o problema cand fac una din cele 2 curse am incercat sa setez un chackpoint sa se duca inapoi unde e jobul sa poti lua alta remorca si sa incepi o noua cursa,si nu inteleg dece nu imi afiseaza chackpointul .

 

case 9:
      {
         if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
         {
            ShowPlayerDialog(playerid, DIALOG_TRUCKER1, DIALOG_STYLE_LIST, "Server: Trucker", "Sinybed /nCommerce", "Select", "Cancel");
         }
         else
         {
            SCM(playerid, -1, "You need to have a trailer attached!");
         }
         /*new Float: pos[3];
         GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
         if(doesVehicleExist(playerVariables[playerid][pTruckID]))
         {
            DestroyVehicle(playerVariables[playerid][pTruckID]);
         }
         playerVariables[playerid][pTruckID] = CreateVehicle(591,pos[0], pos[1], pos[2], 1,-1, -1, -1);
         OnVehicleStreamIn(playerVariables[playerid][pTruckID], playerid);
         DisablePlayerCheckpoint(playerid);
         playerVariables[playerid][pCheckpoint] = 0;
         SetTimerEx("trucker", 1000, 0, "i", playerid);*/
      }
      case 10:
      {
         if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
         {
            new randpay = 5000 + playerVariables[playerid][pTruckSkill] * 7000 + random(5000);
            playerVariables[playerid][pMoney] += randpay;
            format(szMessage, sizeof(szMessage), "You've got $%s for this transport!", NumberFormat(randpay));
            SCM(playerid, -1, szMessage);
            DisablePlayerCheckpoint(playerid);
            playerVariables[playerid][pTruckRem]--;
            playerVariables[playerid][pTruckTimes]++;
            SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
            if(playerVariables[playerid][pTruckSkill] <= 1)
            {
               if(playerVariables[playerid][pTruckRem] == 0)
               {
                  playerVariables[playerid][pTruckSkill]++;
                  playerVariables[playerid][pTruckRem] = playerVariables[playerid][pTruckSkill] * 50;
                  format(szMessage, sizeof(szMessage), "Congratulations! Your Trucking skill is now %d.", playerVariables[playerid][pTruckSkill]);
                  SCM(playerid, COLOR_YELLOW, szMessage);
               }
            }
            Truck[playerid] = 0;
         }
         else
         {
            SCM(playerid, -1, "You need to have a trailer attached!");
         }
      }
      case 11:
      {
         if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
         {
            ShowPlayerDialog(playerid, DIALOG_TRUCKER2, DIALOG_STYLE_LIST, "Server: Trucker Job", "Las Payasadas\nMontgomery", "Select", "Cancel");
         }
         else
         {
            SCM(playerid, -1, "You need to have a trailer attached!");
         }
      }
      case 12:
      {
         if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
         {
            new randpay = 5000 + playerVariables[playerid][pTruckSkill] * 7000 + random(5000);
            playerVariables[playerid][pMoney] += randpay;
            format(szMessage, sizeof(szMessage), "You've got $%s for this transport!", NumberFormat(randpay));
            SCM(playerid, -1, szMessage);
            DisablePlayerCheckpoint(playerid);
            playerVariables[playerid][pTruckRem]--;
            playerVariables[playerid][pTruckTimes]++;
            SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
            if(playerVariables[playerid][pTruckSkill] <= 2)
            {
               if(playerVariables[playerid][pTruckRem] == 0)
               {
                  playerVariables[playerid][pTruckSkill]++;
                  playerVariables[playerid][pTruckRem] = playerVariables[playerid][pTruckSkill] * 50;
                  format(szMessage, sizeof(szMessage), "Congratulations! Your Trucking skill is now %d.", playerVariables[playerid][pTruckSkill]);
                  SCM(playerid, COLOR_YELLOW, szMessage);
               }
            }
            Truck[playerid] = 0;
         }
         else
         {
            SCM(playerid, -1, "You need to have a trailer attached!");
         }
      }
      case 13:
      {
         if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
         {
            ShowPlayerDialog(playerid, DIALOG_TRUCKER3, DIALOG_STYLE_LIST, "Server: Trucker Job", "Randolph Industrial Estate\nLas Payasadas", "Select", "Cancel");
         }
         else
         {
            SCM(playerid, -1, "You need to have a trailer attached!");
         }
      }
      case 14:
      {
         if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
         {
            new randpay = 5000 + playerVariables[playerid][pTruckSkill] * 7000 + random(5000);
            playerVariables[playerid][pMoney] += randpay;
            format(szMessage, sizeof(szMessage), "You've got $%s for this transport!", NumberFormat(randpay));
            SCM(playerid, -1, szMessage);
            DisablePlayerCheckpoint(playerid);
            playerVariables[playerid][pTruckRem]--;
            playerVariables[playerid][pTruckTimes]++;
            SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
            if(playerVariables[playerid][pTruckSkill] <= 3)
            {
               if(playerVariables[playerid][pTruckRem] == 0)
               {
                  playerVariables[playerid][pTruckSkill]++;
                  playerVariables[playerid][pTruckRem] = playerVariables[playerid][pTruckSkill] * 50;
                  format(szMessage, sizeof(szMessage), "Congratulations! Your Trucking skill is now %d.", playerVariables[playerid][pTruckSkill]);
                  SCM(playerid, COLOR_YELLOW, szMessage);
               }
            }
            Truck[playerid] = 0;
         }
         else
         {
            SCM(playerid, -1, "You need to have a trailer attached!");
         }
      }



ONPLAYERENTERCHECKPOINT





DIALOG-URILE


if(dialogid == DIALOG_TRUCKER1)
      {
         if(response)
         {
            switch(listitem)
            {
               case 0:
               {
                  if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                  {
                     SetPlayerCheckpoint(playerid, 2275.4199,64.4884,26.4844,4.0);
                     playerVariables[playerid][pCheckpoint] = 10;
                     Truck[playerid] = 1;
                     SendClientMessage(playerid, COLOR_WHITE,"Drive to the checkpoint to get ~g~ paid~w~", 2000);
                  }
                  else
                  {
                     SCM(playerid, -1, "You need to have a trailer attached!");
                  }
               }
               case 1:
               {
                  if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                  {
                     SetPlayerCheckpoint(playerid,1665.1975,1085.6539,10.8203,4.0);
                     playerVariables[playerid][pCheckpoint] = 12;
                     Truck[playerid] = 1;
                     SendClientMessage(playerid, COLOR_WHITE, "Drive to the checkpoint to get ~g~ paid~w~", 2000);
                  }
                  else
                  {
                     SCM(playerid, -1, "You need to have a trailer attached!");
                  }
               }
            }
            Truck[playerid] = 1;
         }
      }
      if(dialogid == DIALOG_TRUCKER3)
      {
         if(response)
         {
            switch(listitem)
            {
               case 0:
               {
                  if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                  {
                     SetPlayerCheckpoint(playerid, 1647.6088,-1809.1284,13.5342,4.0);
                     playerVariables[playerid][pCheckpoint] = 14;
                     Truck[playerid] = 1;
                     SendClientMessage(playerid, COLOR_WHITE, "Drive to the checkpoint to get ~g~ paid~w~", 2000);
                  }
                  else
                  {
                     SCM(playerid, -1, "You need to have a trailer attached!");
                  }
               }
               case 1:
               {
                  if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                  {
                     SetPlayerCheckpoint(playerid,-311.4373,1059.7863,19.5907,4.0);
                     playerVariables[playerid][pCheckpoint] = 10;
                     Truck[playerid] = 1;
                     SendClientMessage(playerid, COLOR_WHITE,"Drive to the checkpoint to get ~g~ paid~w~", 2000);
                  }
                  else
                  {
                     SCM(playerid, -1, "You need to have a trailer attached!");
                  }
               }
            }
         }
      }
      if(dialogid == DIALOG_TRUCKER2)
      {
         if(response)
         {
            switch(listitem)
            {
               case 0:
               {
                  if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                  {
                     SetPlayerCheckpoint(playerid, 1353.6324,355.0676,20.3287,10);
                     playerVariables[playerid][pCheckpoint] = 14;
                     Truck[playerid] = 1;
                     SendClientMessage(playerid, COLOR_WHITE,"Drive to the checkpoint to get ~g~ paid~w~", 2000);
                  }
                  else
                  {
                     SCM(playerid, -1, "You need to have a trailer attached!");
                  }
               }
               case 1:
               {
                  if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                  {
                     SetPlayerCheckpoint(playerid, -329.3604,2663.2913,63.3984,10);
                     playerVariables[playerid][pCheckpoint] = 12;
                     Truck[playerid] = 1;
                     SendClientMessage(playerid, COLOR_WHITE,"Du-te inapoi da jobul trucker", 2000);
                  }
                  else
                  {
                     SCM(playerid, -1, "You need to have a trailer attached!");
                  }
               }
            }
         }
      }

 

am incercat sal rezolv singur dar nu am reusit, daca ma puteti ajuta va rog ca nush ce sa mai fac...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.