Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ********************************************************************************
- Filterscript: Plantação de Drogas 1.0v
- Desenvolvedor: ProKillerPa
- Direitos Permitidos: Modificações á vontade, créditos manditos.
- | Faça o uso do FS com sabedoria, dentro das normas ditas pelo desenvolvedor |
- Ultima Atualização: 18/10/2014
- ********************************************************************************
- */
- #include a_samp
- #include zcmd
- #include sscanf2
- #include streamer
- #include DOF2
- #define AVISOPLANTIO 1
- #define SLOTMACONHA 2
- #define NOCARROMAC 3
- #define NUMEROSEMENTES 4
- new PlantandoMaconha;
- new TemMaconha[MAX_PLAYERS],
- QuantiaMaconha[MAX_PLAYERS]
- ;
- new MaconhaQuase[7], // Objetos Mac. Quase pro plantio
- MaconhaProntaP[5] // Objetos Mac. pronto pro plantio
- ;
- new ObjEnt[3];
- new Check01,
- Check02
- ;
- new EuPlantei[MAX_PLAYERS],
- MaconhaColhida[MAX_PLAYERS];
- new ObjCar[4];
- new MaconhaProntita[MAX_PLAYERS];
- new TimerQueimarMac[MAX_PLAYERS];
- new Cars[3];
- forward CriarMaconha();
- forward MaconhaPronta(playerid);
- forward QueimarMaconha(playerid);
- forward TirarBarris();
- enum DP{
- Maconha,
- SementesMac,
- Colheu
- }; new DadosP[MAX_PLAYERS][DP];
- public OnPlayerConnect(playerid){
- Create3DTextLabel("{87CEFA}Slot de Plantio!\n{FFD700}Semente Permitida: Maconha", 0x008080FF, -1178.6414,-1091.6329,129.2188, 15.0, 0, 0);
- Check01 = CreateDynamicCP(-1178.6414,-1091.6329,129.2188, 0.8, -1, -1, -1, 100.0);
- new Var_[128], Plantador[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Plantador, sizeof(Plantador));
- format(Var_, sizeof(Var_), "Plantadores/%s.ini", Plantador);
- if(!DOF2_FileExists(Var_)){
- DOF2_CreateFile(Var_);
- DOF2_SetString(Var_, "Nome", Plantador);
- DOF2_SetInt(Var_, "Maconha", 0);
- DOF2_SetInt(Var_, "Sementes Mac", 0);
- DOF2_SetInt(Var_, "Colheu", 0);
- DOF2_SaveFile();
- printf("| AUTO-CONTROLE | O(A) jogador(a) %s criou seu registro de plantador!", Plantador);
- } else {
- DadosP[playerid][Maconha] = DOF2_GetInt(Var_, "Maconha");
- DadosP[playerid][SementesMac] = DOF2_GetInt(Var_, "Sementes Mac");
- DadosP[playerid][Colheu] = DOF2_GetInt(Var_, "Colheu");
- }
- return 1;
- }
- CMD:grana(playerid){
- GivePlayerMoney(playerid, 999999);
- return 1;
- }
- public OnFilterScriptInit(){
- Cars[0] = AddStaticVehicle(478,-1175.2751,-1140.0001,129.2157,354.1185,66,1); // car01carregado
- Cars[1] = AddStaticVehicle(478,-1171.0756,-1139.9646,129.2197,358.5255,59,1); // car02carregado
- return 1;
- }
- CMD:plantar(playerid){
- ShowPlayerDialog(playerid, AVISOPLANTIO, DIALOG_STYLE_MSGBOX, "{BEBEBE}Slot de Plantio!", "{FA8072}S.A Plantadora\n\n{BEBEBE}Cada Slot destinado á plantio é separado por grupos, certifique-se você está no Slot certo com as sementes corretas!\n\nSó será possível plantar neste Slot com as sementes corretas.\n\n{1E90FF}Deseja Processeguir?", "Sim", "Não");
- return 1;
- }
- public QueimarMaconha(playerid){
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | A Maconha que você plantou foi queimada devido á demora na colheita!");
- SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Você não será reembolsado por essa ação indevida.");
- PlantandoMaconha = 0;
- DestroyObject(MaconhaProntaP[0]);
- DestroyObject(MaconhaProntaP[1]);
- DestroyObject(MaconhaProntaP[2]);
- DestroyObject(MaconhaProntaP[3]);
- DestroyObject(MaconhaProntaP[4]);
- return 1;
- }
- public MaconhaPronta(playerid){
- SendClientMessage(playerid, -1, "");
- SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | A Maconha que você plantou está pronta para colheita! ");
- SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Você terá 1 Minuto para colhe-la antes que ela será queimada!");
- TimerQueimarMac[playerid] = SetTimerEx("QueimarMaconha", 25000, false, "i", playerid);
- MaconhaProntita[playerid] = 1;
- MaconhaProntaP[0] = CreateObject(823, -1170.09998, -1095, 128.7, 0, 22, 0);
- MaconhaProntaP[1] = CreateObject(823, -1175.09998, -1095.59998, 128.7, 0, 21.995, 0);
- MaconhaProntaP[2] = CreateObject(823, -1179.09998, -1095.59998, 128.7, 0, 21.995, 0);
- MaconhaProntaP[3] = CreateObject(823, -1182.40002, -1095.5, 128.7, 0, 21.995, 0);
- MaconhaProntaP[4] = CreateObject(823, -1186.90002, -1095.80005, 128.7, 0, 21.995, 0);
- DestroyObject(MaconhaQuase[0]);
- DestroyObject(MaconhaQuase[1]);
- DestroyObject(MaconhaQuase[2]);
- DestroyObject(MaconhaQuase[3]);
- DestroyObject(MaconhaQuase[4]);
- DestroyObject(MaconhaQuase[5]);
- DestroyObject(MaconhaQuase[6]);
- return 1;
- }
- CMD:colher(playerid){
- if(PlantandoMaconha == 1){
- if(EuPlantei[playerid] == 1){
- if(MaconhaProntita[playerid] == 1){
- if(IsPlayerInRangeOfPoint(playerid, 2.0, -1177.7119,-1093.1257,129.2188)){
- PlantandoMaconha = 0;
- EuPlantei[playerid] = 0;
- MaconhaProntita[playerid] = 0;
- SendClientMessage(playerid, -1, "| INFO | Você colheu a maconha com sucesso, vá vende-la no ponto indicado no seu mini-mapa com o carro carregado!");
- MaconhaColhida[playerid] = 1;
- DestroyObject(MaconhaProntaP[0]);
- DestroyObject(MaconhaProntaP[1]);
- DestroyObject(MaconhaProntaP[2]);
- DestroyObject(MaconhaProntaP[3]);
- DestroyObject(MaconhaProntaP[4]);
- KillTimer(TimerQueimarMac[playerid]);
- ObjCar[0] = CreateObject(1217,0,0,-1000,0,0,0,100);
- ObjCar[1] = CreateObject(1217,0,0,-1000,0,0,0,100);
- ObjCar[2] = CreateObject(1217,0,0,-1000,0,0,0,100);
- ObjCar[3] = CreateObject(1217,0,0,-1000,0,0,0,100);
- Cars[2] = AddStaticVehicle(478,-1166.4277,-1139.5294,129.2089,1.9437,45,1); // car03carregado
- AttachObjectToVehicle(ObjCar[0], Cars[2], 0.539999,-2.025000,0.000000,0.000000,0.000000,0.000000);
- AttachObjectToVehicle(ObjCar[1], Cars[2], -0.360000,-2.025000,0.000000,0.000000,0.000000,0.000000);
- AttachObjectToVehicle(ObjCar[2], Cars[2], -0.360000,-2.025000,0.000000,0.000000,0.000000,0.000000);
- AttachObjectToVehicle(ObjCar[3], Cars[2], -0.360000,-0.899999,0.000000,0.000000,0.000000,0.000000);
- PutPlayerInVehicle(playerid, Cars[2], 0);
- ShowPlayerDialog(playerid, NOCARROMAC, DIALOG_STYLE_MSGBOX, "{BEBEBE}Entregar Maconha", "{FA8072}S.A Plantadora!\n\n{BEBEBE}Os galões na traseira do carro estão carregados com a maconha colhida por você.\n\nEssa medida foi tomada como disfarce para os policiais que rondam essa região de plantio ilegal.\n\n{1E90FF}Siga o Checkpoint no seu mapa para entregar a maconha e receber dinheiro por elas.", "Fechar", "");
- DestroyDynamicCP(Check01);
- Check02 = SetPlayerCheckpoint(playerid, -1652.2321,-2541.3550,16.1046, 0.8);
- Create3DTextLabel("{87CEFA}Local de Entrega!\n{FFD700}Digite /entregar", 0x008080FF, -1652.2321,-2541.3550,16.1046, 15.0, 0, 0);
- } else return SendClientMessage(playerid, -1, "| SLOT | Você deve estar próximo ao Slot para colher!");
- } else return SendClientMessage(playerid, -1, "| SLOT | A Maconha não está pronta para ser colhida agora!");
- } else return SendClientMessage(playerid, -1, "| SLOT | Você não plantou essas sementes, por isso não pode colhe-las!");
- } else return SendClientMessage(playerid, -1, "| SLOT | Não há nenhuma semente de maconha plantada no Slot!");
- return 1;
- }
- CMD:comprarsementes(playerid){
- ShowPlayerDialog(playerid, NUMEROSEMENTES, DIALOG_STYLE_INPUT, "Comprar Sementes", "S.A Plantadora!\n\nDigite abaixo o número de pacotes que deseja comprar de sementes de maconha.\n\nUm pacote possui 30 sementes, sendo necessário ás 60 sementes para o um plantio!", "Comprar", "Cancelar");
- return 1;
- }
- public TirarBarris(){
- DestroyObject(ObjEnt[0]);
- DestroyObject(ObjEnt[1]);
- DestroyObject(ObjEnt[2]);
- return 1;
- }
- CMD:entregar(playerid){
- if(IsPlayerInRangeOfPoint(playerid, 30.0, -1652.2321,-2541.3550,16.1046)){
- if(MaconhaColhida[playerid] == 1){
- SendClientMessage(playerid, -1, "{BEBEBE}| FIM | Você entregou a mercadoria com sucesso! Uma pessoa irá vir pegar os barris carregados.");
- SendClientMessage(playerid, -1, "{BEBEBE}| FIM | Agora saia desde local sem chamar suspeitas");
- MaconhaColhida[playerid] = 0;
- DisablePlayerCheckpoint(Check02);
- Check01 = CreateDynamicCP(-1178.6414,-1091.6329,129.2188, 0.8, -1, -1, -1, 100.0);
- ObjEnt[0] = CreateObject(1217, -1649.7056,-2542.2698,15.9823, 0,0,0,100);
- ObjEnt[1] = CreateObject(1217, -1649.9158,-2543.3005,15.9432, 0,0,0,100);
- ObjEnt[2] = CreateObject(1217, -1650.8456,-2543.3225,15.9723, 0,0,0,100);
- DestroyObject(ObjCar[0]);
- DestroyObject(ObjCar[1]);
- DestroyObject(ObjCar[2]);
- DestroyObject(ObjCar[3]);
- SetTimer("TirarBarris", 60000*3, false);
- } else return SendClientMessage(playerid, -1, "| ERRO | Você não colheu nada!");
- } else return SendClientMessage(playerid, -1, "| ERRO | Você não está no local da entrega!");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
- new Var_[128], Plantador[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Plantador, sizeof(Plantador));
- if(dialogid == NUMEROSEMENTES){
- if(!response) return 1;
- new _Var[150];
- if(strval(inputtext) > GetPlayerMoney(playerid))
- return SendClientMessage(playerid, -1, "| INFO | Você não possui dinheiro suficiente para comprar o número de pacotes solicitados!");
- GivePlayerMoney(playerid, GetPlayerMoney(playerid) - strval(inputtext));
- format(_Var, sizeof(_Var), "{BEBEBE}| INFO | Você comprou %d pacotes, totalizando %d sementes de maconha. Você poderá fazer %d plantações com as semente compradas!", strval(inputtext), strval(inputtext) * 30, strval(inputtext) * 30 / 60);
- SendClientMessage(playerid, -1, _Var);
- new VarMarota = strval(inputtext) * 30;
- DOF2_SetInt(Var_, "Sementes Mac", DadosP[playerid][SementesMac] + VarMarota);
- DOF2_SetInt(Var_, "Maconha", 1);
- DOF2_SaveFile();
- TemMaconha[playerid] = 1;
- QuantiaMaconha[playerid] = 60;
- }
- if(dialogid == AVISOPLANTIO){
- if(!response) return SendClientMessage(playerid, -1, "| INFO | Plantio neste Slot foi cancelado!");
- if(IsPlayerInRangeOfPoint(playerid, 2.0, -1177.7119,-1093.1257,129.2188)){ // SLOT DE MACONHA!
- new _Var[300];
- format(_Var, sizeof(_Var), "{FA8072}S.A Plantadora!\n\n{BEBEBE}Este Slot é de uso único por vez e é válido apenas para sementes de maconha!\n\nSementes plantadas em slots errados seram perdidas e não darão resultados!\n\n{1E90FF}Deseja plantar suas sementes neste Slot?");
- ShowPlayerDialog(playerid, SLOTMACONHA, DIALOG_STYLE_MSGBOX, "{BEBEBE}Slot - Maconha", _Var, "Sim", "Não");
- } else SendClientMessage(playerid, -1, "| ERRO | Você não está em um Slot de plantio!");
- }
- if(dialogid == SLOTMACONHA){
- if(!response) return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Você cancelou o plantio neste slot!");
- if(PlantandoMaconha == 0){
- if(TemMaconha[playerid] == 1) {
- if(QuantiaMaconha[playerid] >= 60){
- PlantandoMaconha = 1;
- EuPlantei[playerid] = 1;
- QuantiaMaconha[playerid] = DadosP[playerid][SementesMac] - 60;
- SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Você plantou suas sementes neste Slot, aguarde até elas estarem pronto para plantio!");
- SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Após a maconha estiver pronta para plantio, caso não seja colhida elas serão queimadas.");
- //Maconha plantada.
- MaconhaQuase[0] = CreateObject(811, -1169.40002, -1096.5, 129.39999, 0, 0, 0);
- MaconhaQuase[1] = CreateObject(811, -1172.69995, -1096.40002, 129.39999, 0, 0, 0);
- MaconhaQuase[2] = CreateObject(811, -1176.19995, -1096.59998, 129.39999, 0, 0, 0);
- MaconhaQuase[3] = CreateObject(811, -1179.40002, -1096.19995, 129.39999, 0, 0, 0);
- MaconhaQuase[4] = CreateObject(811, -1182.40002, -1096.40002, 129.39999, 0, 0, 0);
- MaconhaQuase[5] = CreateObject(811, -1185.59998, -1096.59998, 129.39999, 0, 0, 0);
- MaconhaQuase[6] = CreateObject(811, -1188.59998, -1096.80005, 129.39999, 0, 0, 0);
- SetTimerEx("MaconhaPronta", 5000, false, "i", playerid);
- format(Var_, sizeof(Var_), "Plantadores/%s.ini", Plantador);
- DOF2_SetInt(Var_, "Sementes Mac", QuantiaMaconha[playerid]);
- DOF2_SaveFile();
- } else return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Você não possui sementes suficientes para plantar neste Slot!");
- } else return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Você não possui sementes para plantar neste Slot!");
- } else return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Já existe sementes plantadas neste Slot, aguarde elas germinarem para plantar as suas.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement