Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Includes Fundamentais HAHA *-*
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- //Defines Times
- #define Caminhoneiro 1
- #define CorCaminhoneiro 0xAAF1FAFF
- //Defines Macros
- #define SCM SendClientMessage
- #define SCMA SendClientMessageToAll
- //Define Dialogo!
- #define DialogoTrabalhos 155
- enum CaminhoneiroMissao //Essa enum só serve para as missões,não retire,se quiser modifique!
- {
- ID,
- NomeCarregar[128],
- Float:CarregarX,
- Float:CarregarY,
- Float:CarregarZ,
- NomeDescarregar[128],
- Float:DescarregarX,
- Float:DescarregarY,
- Float:DescarregarZ,
- Pagamento,
- NomeCarga[128]
- }
- enum MissaoInfo
- {
- Classe,
- Trabalhando
- }
- new Missao[MAX_PLAYERS][MissaoInfo];
- new MisCaminhoneiro[][CaminhoneiroMissao] =
- {
- {0, "Missão 1", 0.0, 0.0, 0.0, "Missão 2", 0.0, 0.0, 0.0, 1000, "Cimento"},
- {1, "Missão 3", 0.0, 0.0, 0.0, "Missão 4", 0.0, 0.0, 0.0, 1000, "Cimento"},
- {2, "Missão 5", 0.0, 0.0, 0.0, "Missão 6", 0.0, 0.0, 0.0, 1000, "Cimento"},
- {3, "Missão 7", 0.0, 0.0, 0.0, "Missão 8", 0.0, 0.0, 0.0, 1000, "Cimento"},
- {4, "Missão 9", 0.0, 0.0, 0.0, "Missão 10", 0.0, 0.0, 0.0, 1000, "Cimento"}
- }; //{ID, "Nome do Lugar de Carregar", Coordenadas de carregar, "Nome do Lugar de Descarregar", Coordenadas de descarregar, Pagamento, "Oque Carregar"},
- new Float:SpawnCaminhoneiro[][4] = //Spawn Escolha os SpawnsRandoms!
- {
- {-1574.3555, -2747.2380, 48.5391},
- {-1574.3555, -2747.2380, 48.5391},
- {-1574.3555, -2747.2380, 48.5391}
- };
- forward Descongelar(playerid);
- public Descongelar(playerid)
- {
- TogglePlayerControllable(playerid, true);
- return 1;
- }
- public OnGameModeInit()
- {
- //Classe
- AddPlayerClass(6, 00.00, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);//Caminhoneiro 0
- AddPlayerClass(32, 00.00, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);//Caminhoneiro 1
- AddPlayerClass(131, 00.00, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);//Caminhoneiro 2
- //Carros Spawn 1,2,3
- AddStaticVehicleEx(515,-1545.1810000,-2747.9026000,49.5388000,169.5600000,-1,-1,15); //Roadtrain
- AddStaticVehicleEx(515,-1540.5913000,-2750.2205000,49.4988000,169.5600000,-1,-1,15); //Roadtrain
- AddStaticVehicleEx(515,-1535.9431000,-2753.1897000,49.5188000,169.5600000,-1,-1,15); //Roadtrain
- AddStaticVehicleEx(435,-1531.0387000,-2754.3723000,49.0663000,168.7800000,-1,-1,15); //Trailer 1
- AddStaticVehicleEx(435,-1526.4016000,-2756.6875000,49.0663000,168.7800000,-1,-1,15); //Trailer 1
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- switch(classid)
- {
- case 0,1,2:
- {
- GameTextForPlayer(playerid, "~y~~h~~h~Caminhoneiro", 3000, 4);
- Missao[playerid][Classe] = Caminhoneiro;
- SetPlayerPos(playerid, 2179.413574, 1285.552368, 42.549133);
- SetPlayerFacingAngle(playerid, 89.761169);
- SetPlayerCameraLookAt(playerid, 2179.413574, 1285.552368, 42.549133);
- SetPlayerCameraPos(playerid, 2179.413574 + (5 * floatsin(-89.761169, degrees)), 1285.552368 + (5 * floatcos(-89.761169, degrees)), 42.549133);
- }
- }
- if(Missao[playerid][Classe] == Caminhoneiro)
- {
- SetPlayerColor(playerid, CorCaminhoneiro);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(Missao[playerid][Classe] == Caminhoneiro)
- {
- new rand = random(sizeof(SpawnCaminhoneiro));
- SetPlayerPos(playerid, SpawnCaminhoneiro[rand][0], SpawnCaminhoneiro[rand][1], SpawnCaminhoneiro[rand][2]);
- SetPlayerFacingAngle(playerid, SpawnCaminhoneiro[rand][3]);
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(Missao[playerid][Trabalhando] == 1)
- {
- switch(Missao[playerid][Classe])
- {
- case Caminhoneiro:
- {
- new vID = GetPlayerVehicleID(playerid);
- if(GetVehicleModel(vID) == 403 || GetVehicleModel(vID) == 515 || GetVehicleModel(vID) == 514 || GetVehicleModel(vID) == 455 || GetVehicleModel(vID) == 578)
- {
- if(!IsTrailerAttachedToVehicle(vID)) return SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você está sem trailer !!");
- TogglePlayerControllable(playerid, false);
- GameTextForPlayer(playerid, "Descarregue Agora!", 5000, 4);
- GameTextForPlayer(playerid, "Carregando...", 3000, 4);
- SetTimerEx("Descongelar", 5000, false, "i", playerid);
- DisablePlayerCheckpoint(playerid);
- SetPlayerCheckpoint(playerid, MisCaminhoneiro[playerid][DescarregarX], MisCaminhoneiro[playerid][DescarregarY], MisCaminhoneiro[playerid][DescarregarZ], 10.0);
- Missao[playerid][Trabalhando] = 2;
- }
- else
- {
- SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você deve está dentro de um caminhão para Carregar!");
- }
- }
- }
- }
- else if(Missao[playerid][Trabalhando] == 2)
- {
- switch(Missao[playerid][Classe])
- {
- case Caminhoneiro:
- {
- new vID = GetPlayerVehicleID(playerid);
- if(GetVehicleModel(vID) == 403 || GetVehicleModel(vID) == 515 || GetVehicleModel(vID) == 514 || GetVehicleModel(vID) == 455 || GetVehicleModel(vID) == 578)
- {
- if(!IsTrailerAttachedToVehicle(vID)) return SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você está sem trailer !!");
- TogglePlayerControllable(playerid, false);
- GameTextForPlayer(playerid, "Trabalho Concluido!", 5000, 4);
- GameTextForPlayer(playerid, "Descarregando...", 3000, 4);
- SetTimerEx("Descongelar", 5000, false, "i", playerid);
- DisablePlayerCheckpoint(playerid);
- Missao[playerid][Trabalhando] = 0;
- GivePlayerMoney(playerid, MisCaminhoneiro[playerid][Pagamento]);
- SetPlayerScore(playerid, GetPlayerScore(playerid)+2);
- new Linha[100];
- format(Linha, sizeof(Linha), "{FF0000}[INFO]{FFFFFF}: Você concluiu seu trabalho e ganhou : R$ %d e 2 Scores !", MisCaminhoneiro[playerid][Pagamento]);
- SCM(playerid, -1, Linha);
- format(Linha, sizeof(Linha), "{FF0000}[INFO]{FFFFFF}: Você transportou %s, de %s para %s !", MisCaminhoneiro[playerid][NomeCarga], MisCaminhoneiro[playerid][NomeCarregar], MisCaminhoneiro[playerid][NomeDescarregar]);
- SCM(playerid, -1, Linha);
- }
- else
- {
- SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você deve está dentro de um caminhão para Descarregar!");
- }
- }
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DialogoTrabalhos:
- {
- switch(listitem)
- {
- case 0 .. 10:
- {
- if(Missao[playerid][Classe] == Caminhoneiro)
- {
- new Linha[160];
- SetPlayerCheckpoint(playerid, MisCaminhoneiro[listitem][CarregarX], MisCaminhoneiro[listitem][CarregarY], MisCaminhoneiro[listitem][CarregarZ], 10.0);
- format(Linha, sizeof(Linha), "{FF0000}[TRABALHO]{FFFFFF}: Leve a Carga: {FFFF00}%s{FFFFFF} de{FFFF00} %s {FFFFFF}Para{FFFF00} %s",MisCaminhoneiro[listitem][NomeCarga], MisCaminhoneiro[listitem][NomeCarregar], MisCaminhoneiro[listitem][NomeDescarregar]);
- SCM(playerid, -1, Linha);
- Missao[playerid][Trabalhando] = 1;
- }
- }
- }
- }
- }
- return 1;
- }
- CMD:trabalhar(playerid)
- {
- new Msg[400], Linha[100];
- if(Missao[playerid][Trabalhando] > 1) return SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você já está trabalhando !");
- if(Missao[playerid][Classe] == Caminhoneiro)
- {
- new vID = GetPlayerVehicleID(playerid);
- if(GetVehicleModel(vID) == 403 || GetVehicleModel(vID) == 515 || GetVehicleModel(vID) == 514 || GetVehicleModel(vID) == 455 || GetVehicleModel(vID) == 578)
- {
- if(!IsTrailerAttachedToVehicle(vID)) return SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você está sem trailer !!");
- for(new tb = 0; tb < sizeof MisCaminhoneiro; tb++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 10000, MisCaminhoneiro[tb][CarregarX], MisCaminhoneiro[tb][CarregarY], MisCaminhoneiro[tb][CarregarZ]))
- {
- format(Linha, sizeof(Linha), "Transporte %s - De %s - Para %s\n",MisCaminhoneiro[tb][NomeCarga], MisCaminhoneiro[tb][NomeCarregar], MisCaminhoneiro[tb][NomeDescarregar]);
- strcat(Msg, Linha);
- Missao[playerid][Trabalhando] = 1;
- }
- }
- }
- else
- {
- SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você deve está dentro de um caminhão para iniciar o trabalho!");
- }
- ShowPlayerDialog(playerid, DialogoTrabalhos, DIALOG_STYLE_LIST, "Escolha sua Carga", Msg, "Selecionar", "Cancelar");
- }
- return 1;
- }
- CMD:parartrabalho(playerid)
- {
- if(Missao[playerid][Trabalhando] == 0) return SCM(playerid, -1, "{FF0000}[ERRO]{FFFFFF}: Você não está trabalhando para cancelar!");
- DisablePlayerCheckpoint(playerid);
- Missao[playerid][Trabalhando] = 0;
- SCM(playerid, -1, "{FF0000}[INFO]{FFFFFF}: Você cancelou o seu trabalho e pagou :{FF0000} R$ 500");
- GivePlayerMoney(playerid, -500);
- return 1;
- }
- CMD:mudar(playerid)
- {
- ForceClassSelection(playerid);
- SetPlayerHealth(playerid, 0.0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement