Advertisement
Guest User

Plantação de Drogas - FS - By: ProKillerPa

a guest
Oct 17th, 2014
1,822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.96 KB | None | 0 0
  1. /*
  2. ********************************************************************************
  3. Filterscript: Plantação de Drogas 1.0v
  4. Desenvolvedor: ProKillerPa
  5. Direitos Permitidos: Modificações á vontade, créditos manditos.
  6.  
  7. | Faça o uso do FS com sabedoria, dentro das normas ditas pelo desenvolvedor |
  8.  
  9. Ultima Atualização: 18/10/2014
  10.  
  11. ********************************************************************************
  12. */
  13.  
  14.  
  15. #include a_samp
  16. #include zcmd
  17. #include sscanf2
  18. #include streamer
  19. #include DOF2
  20.  
  21. #define AVISOPLANTIO 1
  22. #define SLOTMACONHA 2
  23. #define NOCARROMAC 3
  24. #define NUMEROSEMENTES 4
  25.  
  26. new PlantandoMaconha;
  27.  
  28. new TemMaconha[MAX_PLAYERS],
  29. QuantiaMaconha[MAX_PLAYERS]
  30. ;
  31.  
  32. new MaconhaQuase[7], // Objetos Mac. Quase pro plantio
  33. MaconhaProntaP[5] // Objetos Mac. pronto pro plantio
  34. ;
  35.  
  36. new ObjEnt[3];
  37.  
  38. new Check01,
  39. Check02
  40. ;
  41.  
  42. new EuPlantei[MAX_PLAYERS],
  43. MaconhaColhida[MAX_PLAYERS];
  44.  
  45. new ObjCar[4];
  46.  
  47. new MaconhaProntita[MAX_PLAYERS];
  48.  
  49. new TimerQueimarMac[MAX_PLAYERS];
  50.  
  51. new Cars[3];
  52.  
  53. forward CriarMaconha();
  54. forward MaconhaPronta(playerid);
  55. forward QueimarMaconha(playerid);
  56. forward TirarBarris();
  57.  
  58. enum DP{
  59. Maconha,
  60. SementesMac,
  61. Colheu
  62. }; new DadosP[MAX_PLAYERS][DP];
  63.  
  64. public OnPlayerConnect(playerid){
  65. Create3DTextLabel("{87CEFA}Slot de Plantio!\n{FFD700}Semente Permitida: Maconha", 0x008080FF, -1178.6414,-1091.6329,129.2188, 15.0, 0, 0);
  66.  
  67. Check01 = CreateDynamicCP(-1178.6414,-1091.6329,129.2188, 0.8, -1, -1, -1, 100.0);
  68.  
  69. new Var_[128], Plantador[MAX_PLAYER_NAME];
  70.  
  71. GetPlayerName(playerid, Plantador, sizeof(Plantador));
  72.  
  73. format(Var_, sizeof(Var_), "Plantadores/%s.ini", Plantador);
  74.  
  75. if(!DOF2_FileExists(Var_)){
  76. DOF2_CreateFile(Var_);
  77.  
  78. DOF2_SetString(Var_, "Nome", Plantador);
  79.  
  80. DOF2_SetInt(Var_, "Maconha", 0);
  81. DOF2_SetInt(Var_, "Sementes Mac", 0);
  82. DOF2_SetInt(Var_, "Colheu", 0);
  83.  
  84. DOF2_SaveFile();
  85.  
  86. printf("| AUTO-CONTROLE | O(A) jogador(a) %s criou seu registro de plantador!", Plantador);
  87. } else {
  88. DadosP[playerid][Maconha] = DOF2_GetInt(Var_, "Maconha");
  89. DadosP[playerid][SementesMac] = DOF2_GetInt(Var_, "Sementes Mac");
  90. DadosP[playerid][Colheu] = DOF2_GetInt(Var_, "Colheu");
  91. }
  92.  
  93.  
  94. return 1;
  95. }
  96.  
  97. CMD:grana(playerid){
  98. GivePlayerMoney(playerid, 999999);
  99. return 1;
  100. }
  101.  
  102. public OnFilterScriptInit(){
  103.  
  104. Cars[0] = AddStaticVehicle(478,-1175.2751,-1140.0001,129.2157,354.1185,66,1); // car01carregado
  105. Cars[1] = AddStaticVehicle(478,-1171.0756,-1139.9646,129.2197,358.5255,59,1); // car02carregado
  106. return 1;
  107. }
  108.  
  109. CMD:plantar(playerid){
  110. 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");
  111. return 1;
  112. }
  113.  
  114. public QueimarMaconha(playerid){
  115. SendClientMessage(playerid, -1, "");
  116. SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | A Maconha que você plantou foi queimada devido á demora na colheita!");
  117. SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Você não será reembolsado por essa ação indevida.");
  118.  
  119. PlantandoMaconha = 0;
  120.  
  121. DestroyObject(MaconhaProntaP[0]);
  122. DestroyObject(MaconhaProntaP[1]);
  123. DestroyObject(MaconhaProntaP[2]);
  124. DestroyObject(MaconhaProntaP[3]);
  125. DestroyObject(MaconhaProntaP[4]);
  126. return 1;
  127. }
  128.  
  129. public MaconhaPronta(playerid){
  130. SendClientMessage(playerid, -1, "");
  131. SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | A Maconha que você plantou está pronta para colheita! ");
  132. SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Você terá 1 Minuto para colhe-la antes que ela será queimada!");
  133.  
  134. TimerQueimarMac[playerid] = SetTimerEx("QueimarMaconha", 25000, false, "i", playerid);
  135.  
  136. MaconhaProntita[playerid] = 1;
  137.  
  138. MaconhaProntaP[0] = CreateObject(823, -1170.09998, -1095, 128.7, 0, 22, 0);
  139. MaconhaProntaP[1] = CreateObject(823, -1175.09998, -1095.59998, 128.7, 0, 21.995, 0);
  140. MaconhaProntaP[2] = CreateObject(823, -1179.09998, -1095.59998, 128.7, 0, 21.995, 0);
  141. MaconhaProntaP[3] = CreateObject(823, -1182.40002, -1095.5, 128.7, 0, 21.995, 0);
  142. MaconhaProntaP[4] = CreateObject(823, -1186.90002, -1095.80005, 128.7, 0, 21.995, 0);
  143.  
  144. DestroyObject(MaconhaQuase[0]);
  145. DestroyObject(MaconhaQuase[1]);
  146. DestroyObject(MaconhaQuase[2]);
  147. DestroyObject(MaconhaQuase[3]);
  148. DestroyObject(MaconhaQuase[4]);
  149. DestroyObject(MaconhaQuase[5]);
  150. DestroyObject(MaconhaQuase[6]);
  151. return 1;
  152. }
  153.  
  154. CMD:colher(playerid){
  155. if(PlantandoMaconha == 1){
  156. if(EuPlantei[playerid] == 1){
  157. if(MaconhaProntita[playerid] == 1){
  158. if(IsPlayerInRangeOfPoint(playerid, 2.0, -1177.7119,-1093.1257,129.2188)){
  159. PlantandoMaconha = 0;
  160. EuPlantei[playerid] = 0;
  161. MaconhaProntita[playerid] = 0;
  162.  
  163. SendClientMessage(playerid, -1, "| INFO | Você colheu a maconha com sucesso, vá vende-la no ponto indicado no seu mini-mapa com o carro carregado!");
  164.  
  165. MaconhaColhida[playerid] = 1;
  166.  
  167. DestroyObject(MaconhaProntaP[0]);
  168. DestroyObject(MaconhaProntaP[1]);
  169. DestroyObject(MaconhaProntaP[2]);
  170. DestroyObject(MaconhaProntaP[3]);
  171. DestroyObject(MaconhaProntaP[4]);
  172.  
  173. KillTimer(TimerQueimarMac[playerid]);
  174.  
  175. ObjCar[0] = CreateObject(1217,0,0,-1000,0,0,0,100);
  176. ObjCar[1] = CreateObject(1217,0,0,-1000,0,0,0,100);
  177. ObjCar[2] = CreateObject(1217,0,0,-1000,0,0,0,100);
  178. ObjCar[3] = CreateObject(1217,0,0,-1000,0,0,0,100);
  179.  
  180. Cars[2] = AddStaticVehicle(478,-1166.4277,-1139.5294,129.2089,1.9437,45,1); // car03carregado
  181.  
  182. AttachObjectToVehicle(ObjCar[0], Cars[2], 0.539999,-2.025000,0.000000,0.000000,0.000000,0.000000);
  183. AttachObjectToVehicle(ObjCar[1], Cars[2], -0.360000,-2.025000,0.000000,0.000000,0.000000,0.000000);
  184. AttachObjectToVehicle(ObjCar[2], Cars[2], -0.360000,-2.025000,0.000000,0.000000,0.000000,0.000000);
  185. AttachObjectToVehicle(ObjCar[3], Cars[2], -0.360000,-0.899999,0.000000,0.000000,0.000000,0.000000);
  186.  
  187. PutPlayerInVehicle(playerid, Cars[2], 0);
  188.  
  189. 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", "");
  190.  
  191. DestroyDynamicCP(Check01);
  192. Check02 = SetPlayerCheckpoint(playerid, -1652.2321,-2541.3550,16.1046, 0.8);
  193. Create3DTextLabel("{87CEFA}Local de Entrega!\n{FFD700}Digite /entregar", 0x008080FF, -1652.2321,-2541.3550,16.1046, 15.0, 0, 0);
  194.  
  195. } else return SendClientMessage(playerid, -1, "| SLOT | Você deve estar próximo ao Slot para colher!");
  196. } else return SendClientMessage(playerid, -1, "| SLOT | A Maconha não está pronta para ser colhida agora!");
  197. } else return SendClientMessage(playerid, -1, "| SLOT | Você não plantou essas sementes, por isso não pode colhe-las!");
  198. } else return SendClientMessage(playerid, -1, "| SLOT | Não há nenhuma semente de maconha plantada no Slot!");
  199. return 1;
  200. }
  201.  
  202. CMD:comprarsementes(playerid){
  203. 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");
  204. return 1;
  205. }
  206.  
  207. public TirarBarris(){
  208.  
  209. DestroyObject(ObjEnt[0]);
  210. DestroyObject(ObjEnt[1]);
  211. DestroyObject(ObjEnt[2]);
  212. return 1;
  213. }
  214.  
  215. CMD:entregar(playerid){
  216. if(IsPlayerInRangeOfPoint(playerid, 30.0, -1652.2321,-2541.3550,16.1046)){
  217. if(MaconhaColhida[playerid] == 1){
  218. SendClientMessage(playerid, -1, "{BEBEBE}| FIM | Você entregou a mercadoria com sucesso! Uma pessoa irá vir pegar os barris carregados.");
  219. SendClientMessage(playerid, -1, "{BEBEBE}| FIM | Agora saia desde local sem chamar suspeitas");
  220. MaconhaColhida[playerid] = 0;
  221.  
  222. DisablePlayerCheckpoint(Check02);
  223. Check01 = CreateDynamicCP(-1178.6414,-1091.6329,129.2188, 0.8, -1, -1, -1, 100.0);
  224.  
  225. ObjEnt[0] = CreateObject(1217, -1649.7056,-2542.2698,15.9823, 0,0,0,100);
  226. ObjEnt[1] = CreateObject(1217, -1649.9158,-2543.3005,15.9432, 0,0,0,100);
  227. ObjEnt[2] = CreateObject(1217, -1650.8456,-2543.3225,15.9723, 0,0,0,100);
  228.  
  229. DestroyObject(ObjCar[0]);
  230. DestroyObject(ObjCar[1]);
  231. DestroyObject(ObjCar[2]);
  232. DestroyObject(ObjCar[3]);
  233.  
  234. SetTimer("TirarBarris", 60000*3, false);
  235.  
  236. } else return SendClientMessage(playerid, -1, "| ERRO | Você não colheu nada!");
  237.  
  238. } else return SendClientMessage(playerid, -1, "| ERRO | Você não está no local da entrega!");
  239. return 1;
  240. }
  241.  
  242. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  243.  
  244. new Var_[128], Plantador[MAX_PLAYER_NAME];
  245.  
  246. GetPlayerName(playerid, Plantador, sizeof(Plantador));
  247.  
  248. if(dialogid == NUMEROSEMENTES){
  249. if(!response) return 1;
  250.  
  251. new _Var[150];
  252.  
  253. if(strval(inputtext) > GetPlayerMoney(playerid))
  254. return SendClientMessage(playerid, -1, "| INFO | Você não possui dinheiro suficiente para comprar o número de pacotes solicitados!");
  255.  
  256. GivePlayerMoney(playerid, GetPlayerMoney(playerid) - strval(inputtext));
  257.  
  258. 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);
  259. SendClientMessage(playerid, -1, _Var);
  260.  
  261. new VarMarota = strval(inputtext) * 30;
  262.  
  263. DOF2_SetInt(Var_, "Sementes Mac", DadosP[playerid][SementesMac] + VarMarota);
  264. DOF2_SetInt(Var_, "Maconha", 1);
  265. DOF2_SaveFile();
  266.  
  267. TemMaconha[playerid] = 1;
  268. QuantiaMaconha[playerid] = 60;
  269.  
  270. }
  271. if(dialogid == AVISOPLANTIO){
  272. if(!response) return SendClientMessage(playerid, -1, "| INFO | Plantio neste Slot foi cancelado!");
  273.  
  274. if(IsPlayerInRangeOfPoint(playerid, 2.0, -1177.7119,-1093.1257,129.2188)){ // SLOT DE MACONHA!
  275. new _Var[300];
  276. 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?");
  277. ShowPlayerDialog(playerid, SLOTMACONHA, DIALOG_STYLE_MSGBOX, "{BEBEBE}Slot - Maconha", _Var, "Sim", "Não");
  278. } else SendClientMessage(playerid, -1, "| ERRO | Você não está em um Slot de plantio!");
  279. }
  280. if(dialogid == SLOTMACONHA){
  281. if(!response) return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Você cancelou o plantio neste slot!");
  282.  
  283. if(PlantandoMaconha == 0){
  284. if(TemMaconha[playerid] == 1) {
  285. if(QuantiaMaconha[playerid] >= 60){
  286.  
  287. PlantandoMaconha = 1;
  288. EuPlantei[playerid] = 1;
  289.  
  290. QuantiaMaconha[playerid] = DadosP[playerid][SementesMac] - 60;
  291.  
  292. SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Você plantou suas sementes neste Slot, aguarde até elas estarem pronto para plantio!");
  293. SendClientMessage(playerid, -1, "{BEBEBE}| SLOT | Após a maconha estiver pronta para plantio, caso não seja colhida elas serão queimadas.");
  294.  
  295. //Maconha plantada.
  296. MaconhaQuase[0] = CreateObject(811, -1169.40002, -1096.5, 129.39999, 0, 0, 0);
  297. MaconhaQuase[1] = CreateObject(811, -1172.69995, -1096.40002, 129.39999, 0, 0, 0);
  298. MaconhaQuase[2] = CreateObject(811, -1176.19995, -1096.59998, 129.39999, 0, 0, 0);
  299. MaconhaQuase[3] = CreateObject(811, -1179.40002, -1096.19995, 129.39999, 0, 0, 0);
  300. MaconhaQuase[4] = CreateObject(811, -1182.40002, -1096.40002, 129.39999, 0, 0, 0);
  301. MaconhaQuase[5] = CreateObject(811, -1185.59998, -1096.59998, 129.39999, 0, 0, 0);
  302. MaconhaQuase[6] = CreateObject(811, -1188.59998, -1096.80005, 129.39999, 0, 0, 0);
  303.  
  304. SetTimerEx("MaconhaPronta", 5000, false, "i", playerid);
  305.  
  306. format(Var_, sizeof(Var_), "Plantadores/%s.ini", Plantador);
  307.  
  308. DOF2_SetInt(Var_, "Sementes Mac", QuantiaMaconha[playerid]);
  309.  
  310. DOF2_SaveFile();
  311.  
  312. } else return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Você não possui sementes suficientes para plantar neste Slot!");
  313. } else return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Você não possui sementes para plantar neste Slot!");
  314. } else return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Já existe sementes plantadas neste Slot, aguarde elas germinarem para plantar as suas.");
  315.  
  316. }
  317. return 1;
  318. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement