Advertisement
Guest User

Sistema de colher cocaina simples

a guest
Aug 9th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 9.95 KB | None | 0 0
  1. ////////////////////////////////////////////////////////
  2. //                                                    //
  3. //      Favor não retirar os créditos!                //
  4. //                                                    //
  5. //      FILTERSCRIPT: Sistema de Colher Cocaina       //
  6. //      DATA: 9/08/2013                               //
  7. //      HORA: 19:00                                   //
  8. //      VERSÃO: 1.0                                   //
  9. //      CRIADOR: Caio_Freeze                          //
  10. //                                                    //
  11. //      Favor não retirar os créditos!                //
  12. //                                                    //
  13. ////////////////////////////////////////////////////////
  14.  
  15. #include <a_samp>
  16. #include <zcmd>
  17.  
  18. #define COLOR_RED 0xFF0000FF
  19.  
  20. enum PlayerData
  21. {
  22.     FolhadeCoca,
  23.     Cocaina
  24. }
  25. new PlayerInfo[MAX_PLAYERS][PlayerData];
  26.  
  27. new TempoFabricar;
  28. new TempoColher;
  29.  
  30. new bool:ColhendoFolha[MAX_PLAYERS];
  31. new bool:FabricandoCoca[MAX_PLAYERS];
  32.  
  33. public OnFilterScriptInit()
  34. {
  35.     CreateObject(3409, -1630.69995, -2250.80005, 30.3, 0, 4, 92);
  36.     CreateObject(3409, -1635.69995, -2251.30005, 30.3, 0, 4, 92);
  37.     CreateObject(1594, -1633.5, -2235.69995, 31, 0, 0, 0);
  38.     CreateObject(1494, -1638.09998, -2240, 30.5, 0, 0, 90);
  39.     CreateObject(3261, -1637, -2224.8999, 29.6, 0, 0, 86);
  40.     CreateObject(3261, -1634, -2225.1001, 29.5, 0, 0, 85.995);
  41.     CreateObject(3261, -1631, -2225.2998, 29.4, 0, 0, 86);
  42.     CreateObject(822, -1688.38965, -2222.04395, 39.53904, 0, 0, 0);
  43.     CreateObject(859, -1581.81738, -2227.34863, 25.90131, 0, 0, 0);
  44.     CreateObject(17324, -1644.5, -2273.1001, 34.4, 0, 358, 266);
  45.     CreateObject(1279, -1628.90002, -2235.80005, 30.9, 0, 292, 0);
  46.     CreateObject(1279, -1629, -2234.6001, 30.9, 0, 291.995, 0);
  47.     CreateObject(1279, -1629, -2235.19922, 30.9, 0, 291.995, 0);
  48.     CreateObject(1279, -1628.89941, -2232.59961, 30.9, 0, 291.995, 0);
  49.     CreateObject(1279, -1628.80005, -2233.69995, 30.9, 0, 295.995, 0);
  50.     CreateObject(1279, -1628.89941, -2233.19922, 30.9, 0, 295.994, 0);
  51.     CreateObject(1575, -1633.5, -2235.5, 31.4, 0, 0, 354);
  52.     CreateObject(1744, -1628.19995, -2245.69995, 32.4, 0, 0, 274);
  53.     CreateObject(1744, -1628.19995, -2246.30005, 31.6, 0, 0, 273.999);
  54.     CreateObject(1744, -1628.19995, -2246.30005, 30.8, 0, 0, 273.999);
  55.     CreateObject(1744, -1628.30005, -2244.1001, 30.8, 0, 0, 273.999);
  56.     CreateObject(1744, -1628.30005, -2243.8999, 31.5, 0, 0, 273.999);
  57.     CreateObject(1744, -1628.40002, -2241.8999, 32.9, 0, 0, 273.999);
  58.     CreateObject(1744, -1628.19995, -2245.6001, 33, 0, 0, 273.999);
  59.     CreateObject(1744, -1628.40002, -2241.8999, 32.2, 0, 0, 273.999);
  60.     CreateObject(1744, -1628.40002, -2241.80005, 31.5, 0, 0, 273.999);
  61.     CreateObject(1744, -1628.40002, -2241.80005, 30.8, 0, 0, 273.999);
  62.     CreateObject(1744, -1630.19995, -2247.80005, 31.5, 0, 0, 181.998);
  63.     CreateObject(1744, -1630.19995, -2247.80005, 30.8, 0, 0, 181.994);
  64.     CreateObject(1744, -1632.40002, -2247.8999, 30.8, 0, 0, 181.994);
  65.     CreateObject(1744, -1632.40002, -2247.8999, 31.5, 0, 0, 181.994);
  66.     CreateObject(1744, -1632, -2247.8999, 32.6, 0, 0, 181.994);
  67.     CreateObject(1744, -1632, -2247.8999, 32, 0, 0, 181.994);
  68.     CreateObject(1578, -1628.40002, -2242.80005, 32.1, 0, 286, 350);
  69.     CreateObject(1578, -1628.39941, -2242.69922, 32.8, 0, 285.996, 349.997);
  70.     CreateObject(1578, -1628.40002, -2242.1001, 32, 0, 285.996, 349.997);
  71.     CreateObject(1578, -1628.40002, -2242.1001, 32.8, 0, 285.996, 349.997);
  72.     CreateObject(1578, -1628.40002, -2242.80005, 31.4, 0, 285.996, 349.997);
  73.     CreateObject(1578, -1628.40002, -2242.3999, 31.4, 0, 285.996, 349.997);
  74.     CreateObject(1578, -1628.40002, -2242, 31.4, 0, 285.996, 349.997);
  75.     CreateObject(1578, -1628.40002, -2241.6001, 31.4, 0, 285.996, 349.997);
  76.     CreateObject(1578, -1628.40002, -2241.69995, 32, 0, 285.996, 349.997);
  77.     CreateObject(1578, -1628.5, -2243.8999, 31.3, 0, 285.996, 349.997);
  78.     CreateObject(745, -1654.5, -2265.1001, 33.3, 0, 0, 0);
  79.     CreateObject(745, -1649.59998, -2265.1001, 32.6, 0, 0, 0);
  80.     CreateObject(745, -1644.59998, -2265.80005, 32.5, 0, 0, 0);
  81.     CreateObject(745, -1640.80005, -2265.69995, 32.6, 0, 0, 0);
  82.     CreateObject(745, -1637.19995, -2266.5, 33, 0, 0, 0);
  83.     CreateObject(745, -1632.30005, -2267.3999, 33.4, 0, 0, 0);
  84.    
  85.     Create3DTextLabel("Use /Colher para colher\n folhas de Erythroxylon",-1,-1633.425781,-2250.841796,31.350025,40,0,0);
  86.     return 1;
  87. }
  88.  
  89. public OnFilterScriptExit()
  90. {
  91.     KillTimer(TempoColher);
  92.     KillTimer(TempoFabricar);
  93.     return 1;
  94. }
  95.  
  96. public OnPlayerDisconnect(playerid, reason)
  97. {
  98.     KillTimer(TempoColher);
  99.     KillTimer(TempoFabricar);
  100.     return 1;
  101. }
  102.  
  103. forward Colheu(playerid);
  104. public Colheu(playerid)
  105. {
  106.     ClearAnimations(playerid);
  107.     ColhendoFolha[playerid] = false;
  108.     PlayerInfo[playerid][FolhadeCoca] = 1;
  109.     TogglePlayerControllable(playerid,1);
  110.     SendClientMessage(playerid, 0xFFFF00FF, "Você terminou de colher a folha de Erythroxylon");
  111.     SendClientMessage(playerid, 0xFFFF00FF, "Entre na casa e use /fabricarcocaina");
  112.     return 1;
  113. }
  114.  
  115. forward Fabricou(playerid);
  116. public Fabricou(playerid)
  117. {
  118.     FabricandoCoca[playerid] = false;
  119.     PlayerInfo[playerid][Cocaina] += 25;
  120.     TogglePlayerControllable(playerid,1);
  121.     SendClientMessage(playerid, -1, "Boa, você fabricou 25g de cocaina agora vá ganhar seu dinheiro!");
  122.     return 1;
  123. }
  124.  
  125. //=================================[ Comandos ]===============================//
  126. CMD:colher(playerid, params[])
  127. {
  128.     if(PlayerEstaColhendo(playerid))
  129.     {
  130.         if(ColhendoFolha[playerid] == true)
  131.         {
  132.             SendClientMessage(playerid, COLOR_RED, "Você já está colhendo.");
  133.             return true;
  134.         }
  135.         TogglePlayerControllable(playerid,0);
  136.         ColhendoFolha[playerid] = true;
  137.         ApplyAnimation(playerid, "BOMBER","BOM_Plant",4.0,1,0,0,1,0);
  138.         SendClientMessage(playerid,-1,"Espere 30 segundos para colher a folha de Erythroxylon.");
  139.         TempoColher = SetTimerEx("Colheu", 30000, 0, "i", playerid);
  140.     }
  141.     else return SendClientMessage(playerid, COLOR_RED, "Você não está no local de colher Erythroxylon.");
  142.     return true;
  143. }
  144.  
  145. CMD:ircolher(playerid, params[])
  146. {
  147.     SetPlayerPos(playerid,-1654.0542,-2240.1521,31.2225);
  148.     return 1;
  149. }
  150.  
  151. CMD:fabricarcocaina(playerid, params[])
  152. {
  153.     if(PlayerEstaFabricando(playerid))
  154.     {
  155.         if(FabricandoCoca[playerid] == true)
  156.         {
  157.             SendClientMessage(playerid, COLOR_RED, "Você já está fabricando cocaina.");
  158.             return true;
  159.         }
  160.         if(PlayerInfo[playerid][FolhadeCoca] == 1)
  161.         {
  162.             FabricandoCoca[playerid] = true;
  163.             PlayerInfo[playerid][FolhadeCoca] = 0;
  164.             TogglePlayerControllable(playerid,0);
  165.             SendClientMessage(playerid,-1,"Espere 1 min e meio para fabricar a cocaina.");
  166.             TempoFabricar = SetTimerEx("Fabricou", 60500, 0, "i", playerid);
  167.         }
  168.         else return SendClientMessage(playerid, 0xFFFFFFAA, "Voce nao tem a folha de Erythroxylon.");
  169.     }
  170.     else return SendClientMessage(playerid, COLOR_RED, "Você não está no local de fabricar cocaina.");
  171.     return 1;
  172. }
  173.  
  174. CMD:bolso(playerid, params[])
  175. {
  176.     new string[128];
  177.     SendClientMessage(playerid, -1,"================================");
  178.     format(string, 128, "Cocaina [%dg] Erythroxylon [%d]", PlayerInfo[playerid][Cocaina], PlayerInfo[playerid][FolhadeCoca]);
  179.     SendClientMessage(playerid,0xFF8000FF, string);
  180.     SendClientMessage(playerid, -1,"================================");
  181.     return 1;
  182. }
  183. //=============================[ Fim dos Comandos ]===========================//
  184.  
  185. stock PlayerEstaFabricando(playerid)
  186. {
  187.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1632.7889,-2236.5220,31.4766)) return 1;
  188.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1632.7889,-2236.5220,31.4766)) return 1;
  189.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1634.2389,-2234.9385,31.4766)) return 1;
  190.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1634.2129,-2236.5269,31.4766)) return 1;
  191.     else return 0;
  192. }
  193.  
  194. stock PlayerEstaColhendo(playerid)
  195. {
  196.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1635.7333,-2251.0403,31.3931)) return 1;
  197.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1635.7020,-2249.7278,31.2539)) return 1;
  198.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1635.6799,-2252.1187,31.5068)) return 1;
  199.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1637.2008,-2252.4280,31.5541)) return 1;
  200.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1637.0664,-2251.1914,31.4219)) return 1;
  201.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1637.3744,-2249.8081,31.2784)) return 1;
  202.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1634.3784,-2249.8218,31.2512)) return 1;
  203.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1634.1462,-2250.9580,31.3692)) return 1;
  204.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1633.8936,-2252.0212,31.4793)) return 1;
  205.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1632.2897,-2252.2939,31.4928)) return 1;
  206.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1632.0349,-2250.9780,31.3511)) return 1;
  207.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1632.3875,-2249.4614,31.1878)) return 1;
  208.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1630.7635,-2249.5032,31.1634)) return 1;
  209.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1630.7695,-2250.6357,31.2933)) return 1;
  210.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1630.5670,-2252.1421,31.4622)) return 1;
  211.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1628.9529,-2250.7830,31.2775)) return 1;
  212.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1629.2793,-2249.4817,31.1343)) return 1;
  213.     if(IsPlayerInRangeOfPoint(playerid, 2.0, -1629.3588,-2251.8591,31.4081)) return 1;
  214.     else return 0;
  215. }
  216.  
  217. ////////////////////////////////////////////////////////
  218. //                                                    //
  219. //      Favor não retirar os créditos!                //
  220. //                                                    //
  221. //      FILTERSCRIPT: Sistema de Colher Cocaina       //
  222. //      DATA: 9/08/2013                               //
  223. //      HORA: 19:00                                   //
  224. //      VERSÃO: 1.0                                   //
  225. //      CRIADOR: Caio_Freeze                          //
  226. //                                                    //
  227. //      Favor não retirar os créditos!                //
  228. //                                                    //
  229. ////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement