Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- COMMAND:repetirtrabalho(playerid, params[])
- {
- if(PlayerInfo[playerid][NoEvento] == 1) return SendClientMessage(playerid, -1, "{ff0000}Você está no evento!");
- // Check if the player has logged in
- if (APlayerData[playerid][LoggedIn] == true)
- {
- // First check if the player already has a job
- if (APlayerData[playerid][JobStarted] == false)
- {
- // Check the player's class
- if (APlayerData[playerid][PlayerClass] == ClassTruckDriver)
- {
- if (APlayerData[playerid][TruckerLicense] == 1)
- {
- if (APlayerData[playerid][PCVRepeat] > 0 )
- {
- // Get the id of the convoy (if the player is in a convoy)
- new Convoy = APlayerData[playerid][ConvoyID];
- // Check if the player is part of a convoy AND is not the leader
- if ((APlayerData[playerid][InConvoy] == true) && (AConvoys[Convoy][Members][0] != playerid))
- {
- // Let the player know he's not the leader of his convoy and cannot start a job
- SendClientMessage(playerid, -1, "{FF0000}Você não é o líder do comboio, por tanto não pode iniciar uma missão.");
- // Exit the function
- return 1;
- }
- if ((APlayerData[playerid][InConvoy] == true) && (Convoy_CountMembers(Convoy) == 1) && (AConvoys[Convoy][Members][0] == playerid))
- {
- SendClientMessage(playerid, 0xff0000FF, "Você não pode fazer comboio sozinho, chame amigos!");
- return 1;
- }
- // A convoy-leader proceeds here, and also a normal player (no convoy-member)
- // Check if the player is the driver of a vehicle
- if (GetPlayerVehicleSeat(playerid) == 0)
- {
- new Msgxdddd[2000], lName[100], sName[100], eName[100], tName[128];
- format(lName, 100, ALoads[APlayerData[playerid][RepLoad]][LoadName]);
- format(sName, 100, ALocations[APlayerData[playerid][RepLoc1]][LocationName]);
- format(eName, 100, ALocations[APlayerData[playerid][RepLoc2]][LocationName]);
- // Setup the name of the vehicle you'll need for this mission
- switch(ALoads[APlayerData[playerid][RepLoad]][PCV_Required])
- {
- case PCV_TruckerOreTrailer: format(tName, 128, "Caminhão com trailer caçamba");
- case PCV_TruckerFluidsTrailer: format(tName, 128, "Caminhão com trailer tanque");
- case PCV_TruckerCargoTrailer: format(tName, 128, "Caminhão com trailer baú");
- case PCV_TruckerCementTruck: format(tName, 128, "Caminhão Betoneira");
- case PCV_TruckerNoTrailer: format(tName, 128, "Flatbed ou DFT-30");
- }
- format(Msgxdddd, 2000, "%s{FF8000}Olá {FFFFFF}%s{FF8000}, seu último trabalho foi esse:\n", Msgxdddd, rNome(playerid));
- format(Msgxdddd, 2000, "%s{FF8000}Carga: {FFFFFF}%s\n", Msgxdddd, lName);
- format(Msgxdddd, 2000, "%s{FF8000}Carregamento: {FFFFFF}%s\n", Msgxdddd, sName);
- format(Msgxdddd, 2000, "%s{FF8000}Descarregamento: {FFFFFF}%s\n", Msgxdddd,eName);
- format(Msgxdddd, 2000, "%s{FF8000}%s\n", Msgxdddd,tName);
- format(Msgxdddd, 2000, "%s\n", Msgxdddd);
- format(Msgxdddd, 2000, "%s{FF8000}Deseja repetir o trabalho?\n", Msgxdddd);
- ShowPlayerDialog(playerid, DialogTruckerRepeatLoad, DIALOG_STYLE_MSGBOX, "{FFFFFF}# {FF9900}Repertir trabalho", Msgxdddd, "Sim", "Não");
- }
- else
- SendClientMessage(playerid, -1, "{ff0000}Você precisa estar conduzindo um caminhão para iniciar o trabalho.");
- }
- else
- SendClientMessage(playerid, -1, "{ff0000}Você ainda não tem um trabalho registrado como caminhoneiro.");
- }
- else
- SendClientMessage(playerid, -1, "{ff0000}Você precisa de uma Licença de Caminhoneiro para iniciar a bonus.");
- }
- }
- else // Send a message to let the player know he already has a job
- SendClientMessage(playerid, -1, "{ff0000}Você já está realizando um trabalho!");
- }
- else
- return 0;
- // Let the server know that this was a valid command
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment