Gguiz007

Untitled

Mar 8th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.89 KB | None | 0 0
  1. COMMAND:repetirtrabalho(playerid, params[])
  2. {
  3.  
  4.     if(PlayerInfo[playerid][NoEvento] == 1) return SendClientMessage(playerid, -1, "{ff0000}Você está no evento!");
  5.     // Check if the player has logged in
  6.     if (APlayerData[playerid][LoggedIn] == true)
  7.     {
  8.         // First check if the player already has a job
  9.         if (APlayerData[playerid][JobStarted] == false)
  10.         {
  11.             // Check the player's class
  12.             if (APlayerData[playerid][PlayerClass] == ClassTruckDriver)
  13.             {
  14.                 if (APlayerData[playerid][TruckerLicense] == 1)
  15.                 {
  16.                     if (APlayerData[playerid][PCVRepeat] > 0 )
  17.                     {
  18.                         // Get the id of the convoy (if the player is in a convoy)
  19.                         new Convoy = APlayerData[playerid][ConvoyID];
  20.                          
  21.                         // Check if the player is part of a convoy AND is not the leader
  22.                         if ((APlayerData[playerid][InConvoy] == true) && (AConvoys[Convoy][Members][0] != playerid))
  23.                         {
  24.                             // Let the player know he's not the leader of his convoy and cannot start a job
  25.                             SendClientMessage(playerid, -1, "{FF0000}Você não é o líder do comboio, por tanto não pode iniciar uma missão.");
  26.                             // Exit the function
  27.                             return 1;
  28.                         }
  29.                         if ((APlayerData[playerid][InConvoy] == true) && (Convoy_CountMembers(Convoy) == 1) && (AConvoys[Convoy][Members][0] == playerid))
  30.                         {
  31.                             SendClientMessage(playerid, 0xff0000FF, "Você não pode fazer comboio sozinho, chame amigos!");
  32.                             return 1;
  33.                         }
  34.                         // A convoy-leader proceeds here, and also a normal player (no convoy-member)
  35.                             // Check if the player is the driver of a vehicle
  36.                         if (GetPlayerVehicleSeat(playerid) == 0)
  37.                         {
  38.                             new Msgxdddd[2000], lName[100], sName[100], eName[100], tName[128];
  39.                             format(lName, 100, ALoads[APlayerData[playerid][RepLoad]][LoadName]);
  40.                             format(sName, 100, ALocations[APlayerData[playerid][RepLoc1]][LocationName]);
  41.                             format(eName, 100, ALocations[APlayerData[playerid][RepLoc2]][LocationName]);
  42.                             // Setup the name of the vehicle you'll need for this mission
  43.                             switch(ALoads[APlayerData[playerid][RepLoad]][PCV_Required])
  44.                             {
  45.                                 case PCV_TruckerOreTrailer: format(tName, 128, "Caminhão com trailer caçamba");
  46.                                 case PCV_TruckerFluidsTrailer: format(tName, 128, "Caminhão com trailer tanque");
  47.                                 case PCV_TruckerCargoTrailer: format(tName, 128, "Caminhão com trailer baú");
  48.                                 case PCV_TruckerCementTruck: format(tName, 128, "Caminhão Betoneira");
  49.                                 case PCV_TruckerNoTrailer: format(tName, 128, "Flatbed ou DFT-30");
  50.                             }
  51.                             format(Msgxdddd, 2000, "%s{FF8000}Olá {FFFFFF}%s{FF8000}, seu último trabalho foi esse:\n", Msgxdddd, rNome(playerid));
  52.                             format(Msgxdddd, 2000, "%s{FF8000}Carga: {FFFFFF}%s\n", Msgxdddd, lName);
  53.                             format(Msgxdddd, 2000, "%s{FF8000}Carregamento: {FFFFFF}%s\n", Msgxdddd, sName);
  54.                             format(Msgxdddd, 2000, "%s{FF8000}Descarregamento: {FFFFFF}%s\n", Msgxdddd,eName);
  55.                             format(Msgxdddd, 2000, "%s{FF8000}%s\n", Msgxdddd,tName);
  56.                             format(Msgxdddd, 2000, "%s\n", Msgxdddd);
  57.                             format(Msgxdddd, 2000, "%s{FF8000}Deseja repetir o trabalho?\n", Msgxdddd);
  58.                             ShowPlayerDialog(playerid, DialogTruckerRepeatLoad, DIALOG_STYLE_MSGBOX, "{FFFFFF}# {FF9900}Repertir trabalho", Msgxdddd, "Sim", "Não");
  59.                         }
  60.                         else
  61.                             SendClientMessage(playerid, -1, "{ff0000}Você precisa estar conduzindo um caminhão para iniciar o trabalho.");
  62.                     }
  63.                     else
  64.                         SendClientMessage(playerid, -1, "{ff0000}Você ainda não tem um trabalho registrado como caminhoneiro.");
  65.                 }
  66.                 else
  67.                     SendClientMessage(playerid, -1, "{ff0000}Você precisa de uma Licença de Caminhoneiro para iniciar a bonus.");
  68.             }
  69.         }
  70.         else // Send a message to let the player know he already has a job
  71.             SendClientMessage(playerid, -1, "{ff0000}Você já está realizando um trabalho!");
  72.     }
  73.     else
  74.         return 0;
  75.  
  76.     // Let the server know that this was a valid command
  77.     return 1;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment