Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //==============================================================================                                         *
  2.  
  3.                                                  //Farming System por iTakelot
  4.  
  5.  
  6. //==============================================================================
  7.  
  8.  
  9. #include                       a_samp
  10.  
  11. #include                       zcmd
  12.  
  13. #include                       sscanf2
  14.  
  15.  
  16. //==============================================================================
  17.  
  18. forward Menssagens();
  19.  
  20. #define color_whide         0xffffffff
  21.  
  22. #define color_greey         0x00cc00ff
  23.  
  24. #define color_puple         0xff0000ff
  25.  
  26.  
  27. //==============================================================================
  28.  
  29. NEW RandomColors [] =
  30. {
  31.     0xFFFFFFFF,
  32.     0xFFFF00FF
  33. };
  34.  
  35. NEW Planta,
  36.  
  37.     FarmerVehicles           [ 5 ],
  38.     bool:PlayerFazendeiro    [ MAX_PLAYERS ],
  39.     bool:Pode_Colher         [ MAX_PLAYERS ]
  40. ;
  41.  
  42. //==============================================================================
  43.                                                               //Inicio do script
  44.  
  45.  
  46. //==============================================================================
  47.  
  48. public OnFilterScriptInit(){
  49.  
  50.     FarmerVehicles[0] = AddStaticVehicle(532,-322.2967,-1350.3434,10.5241,270.7830,0,0); // pos 1
  51.  
  52.     FarmerVehicles[1] = AddStaticVehicle(532,-322.6843,-1340.8116,10.3685,272.3377,0,0); // pos 2
  53.  
  54.     FarmerVehicles[2] = AddStaticVehicle(532,-323.0977,-1331.4840,10.4024,271.4319,0,0); // pos 3
  55.  
  56.     FarmerVehicles[3] = AddStaticVehicle(532,-323.1684,-1322.5546,10.4159,270.6801,0,0); // pos 4
  57.  
  58.     FarmerVehicles[4] = AddStaticVehicle(532,-322.1127,-1358.8835,10.8958,269.5284,0,0); // pos 5
  59.  
  60.     print(  "\n_____________________________"  );
  61.    
  62.     print(  "Farming Loaded Por iTakelot ..."  );
  63.    
  64.     print(  "_____________________________\n"  );
  65.  
  66.     SetTimer("Menssagens", 300000, TRUE);
  67.     RETURN 1;
  68. }
  69.  
  70. command(iniciar_p, playerid, params[])
  71. {
  72.     SendClientMessage(playerid, color_greey, "{0080C0}|WAN|: Lucrezi ca fermier, urmareste punctele de pe harta pentru a planta.");
  73.     SetPlayerCheckpoint(playerid, -309.0990,-1381.1797,10.7049, 10);
  74.     RETURN 1;
  75. }
  76.  
  77. command(fazendeiro, playerid, params[])
  78. {
  79.     IF(PlayerFazendeiro[playerid] == TRUE)
  80.         RETURN SendClientMessage(playerid, -1, "{FF0000}|ERROR|: Deja esti fermier!");
  81.        
  82.     SendClientMessage(playerid, color_whide, "{0080C0}|ERROR|: Lucrezi ca fermier");
  83.     SendClientMessage(playerid, color_whide, "{0080C0}|FARM|: Acum lucrezi ca fermier tasteaza /plantar pentru a plata.");
  84.     SetPlayerPos(playerid,-326.2115,-1369.0287,10.7232);
  85.     SetPlayerSkin(playerid,158);
  86.  
  87.     GivePlayerWeapon(playerid, WEAPON_SHOVEL, 64);
  88.     PlayerFazendeiro[playerid] = TRUE;
  89.     RETURN 1 ;
  90. }
  91. command(sair_fazendeiro, playerid, params[])
  92. {
  93.     PlayerFazendeiro[playerid] = TRUE;
  94.     Pode_Colher[playerid] = FALSE;
  95.     DisablePlayerCheckpoint(playerid);
  96.  
  97.     SendClientMessage(playerid, color_whide, "{0080C0}|WAN|: Nu esti fermier.");
  98.     RETURN 1 ;
  99. }
  100.  
  101. command(colher, playerid, params[])
  102. {
  103.     IF (Pode_Colher[playerid] == FALSE) RETURN SendClientMessage(playerid, color_greey, "{0080C0}|ERROR|: Não ah frutos...");
  104.     Pode_Colher[playerid] = FALSE;
  105.     GivePlayerMoney(playerid, 10000);
  106.    
  107.     SendClientMessage(playerid, color_greey, "{00FF00}: Ai recoltat și ai câștigat R$ {FFFF00}10000");
  108.     RETURN 1;
  109. }
  110.  
  111. public OnPlayerConnect(playerid){
  112.     RETURN Pode_Colher[playerid] = FALSE;
  113. }
  114.  
  115. public OnPlayerDeath(playerid, killerid, reason){
  116.  
  117.     RETURN PlayerFazendeiro[playerid] = FALSE;
  118. }
  119.  
  120. public OnPlayerEnterCheckpoint(playerid)
  121. {
  122.     IF(IsPlayerInRangeOfPoint(playerid, 10, -309.0990,-1381.1797,10.7049))
  123.     {
  124.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  125.         DisablePlayerCheckpoint(playerid);
  126.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  127.         SetPlayerCheckpoint(playerid, -286.6838,-1366.6523,9.2448, 10);
  128.         GetPlayerPos(playerid, X, Y, Z);
  129.         GetPlayerFacingAngle(playerid, A);
  130.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  131.     }
  132.     IF(IsPlayerInRangeOfPoint(playerid, 10, -286.6838,-1366.6523,9.2448))
  133.     {
  134.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  135.         DisablePlayerCheckpoint(playerid);
  136.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  137.         SetPlayerCheckpoint(playerid, -299.1016,-1345.1233,7.8737, 10);
  138.         GetPlayerPos(playerid, X, Y, Z);
  139.         GetPlayerFacingAngle(playerid, A);
  140.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  141.     }
  142.     IF(IsPlayerInRangeOfPoint(playerid, 10, -299.1016,-1345.1233,7.8737))
  143.     {
  144.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  145.         DisablePlayerCheckpoint(playerid);
  146.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  147.         SetPlayerCheckpoint(playerid, -285.5391,-1314.0519,9.4996, 10);
  148.         GetPlayerPos(playerid, X, Y, Z);
  149.         GetPlayerFacingAngle(playerid, A);
  150.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  151.     }
  152.     IF(IsPlayerInRangeOfPoint(playerid, 10, -285.5391,-1314.0519,9.4996))
  153.     {
  154.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  155.         DisablePlayerCheckpoint(playerid);
  156.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  157.         SetPlayerCheckpoint(playerid, -263.7585,-1322.7645,9.2727, 10);
  158.         GetPlayerPos(playerid, X, Y, Z);
  159.         GetPlayerFacingAngle(playerid, A);
  160.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  161.     }
  162.     IF(IsPlayerInRangeOfPoint(playerid, 10, -263.7585,-1322.7645,9.2727))
  163.     {
  164.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  165.         DisablePlayerCheckpoint(playerid);
  166.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  167.         SetPlayerCheckpoint(playerid, -247.7353,-1312.8854,10.7708, 10);
  168.         GetPlayerPos(playerid, X, Y, Z);
  169.         GetPlayerFacingAngle(playerid, A);
  170.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  171.     }
  172.     IF(IsPlayerInRangeOfPoint(playerid, 10, -247.7353,-1312.8854,10.7708))
  173.     {
  174.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  175.         DisablePlayerCheckpoint(playerid);
  176.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  177.         SetPlayerCheckpoint(playerid, -230.6390,-1326.7452,10.5278, 10);
  178.         GetPlayerPos(playerid, X, Y, Z);
  179.         GetPlayerFacingAngle(playerid, A);
  180.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  181.     }
  182.     IF(IsPlayerInRangeOfPoint(playerid, 10, -230.6390,-1326.7452,10.5278))
  183.     {
  184.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  185.         DisablePlayerCheckpoint(playerid);
  186.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  187.         SetPlayerCheckpoint(playerid, -208.9200,-1312.6355,8.0123, 10);
  188.         GetPlayerPos(playerid, X, Y, Z);
  189.         GetPlayerFacingAngle(playerid, A);
  190.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  191.     }
  192.     IF(IsPlayerInRangeOfPoint(playerid, 10, -208.9200,-1312.6355,8.0123))
  193.     {
  194.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  195.         DisablePlayerCheckpoint(playerid);
  196.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  197.         SetPlayerCheckpoint(playerid, -184.9501,-1314.5737,6.7411, 10);
  198.         GetPlayerPos(playerid, X, Y, Z);
  199.         GetPlayerFacingAngle(playerid, A);
  200.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  201.     }
  202.     IF(IsPlayerInRangeOfPoint(playerid, 10, -184.9501,-1314.5737,6.7411))
  203.     {
  204.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  205.         DisablePlayerCheckpoint(playerid);
  206.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  207.         SetPlayerCheckpoint(playerid, -165.0671,-1340.6115,3.1610, 10);
  208.         GetPlayerPos(playerid, X, Y, Z);
  209.         GetPlayerFacingAngle(playerid, A);
  210.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  211.     }
  212.     IF(IsPlayerInRangeOfPoint(playerid, 10, -165.0671,-1340.6115,3.1610))
  213.     {
  214.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  215.         DisablePlayerCheckpoint(playerid);
  216.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  217.         SetPlayerCheckpoint(playerid, -182.6981,-1357.5033,4.1997, 10);
  218.         GetPlayerPos(playerid, X, Y, Z);
  219.         GetPlayerFacingAngle(playerid, A);
  220.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  221.     }
  222.     IF(IsPlayerInRangeOfPoint(playerid, 10, -182.6981,-1357.5033,4.1997))
  223.     {
  224.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  225.         DisablePlayerCheckpoint(playerid);
  226.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  227.         SetPlayerCheckpoint(playerid, -166.5868,-1381.2855,3.2646, 10);
  228.         GetPlayerPos(playerid, X, Y, Z);
  229.         GetPlayerFacingAngle(playerid, A);
  230.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  231.     }
  232.     IF(IsPlayerInRangeOfPoint(playerid, 10, -166.5868,-1381.2855,3.2646))
  233.     {
  234.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  235.         DisablePlayerCheckpoint(playerid);
  236.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  237.         SetPlayerCheckpoint(playerid, -169.7452,-1395.7577,3.3153, 10);
  238.         GetPlayerPos(playerid, X, Y, Z);
  239.         GetPlayerFacingAngle(playerid, A);
  240.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  241.     }
  242.     IF(IsPlayerInRangeOfPoint(playerid, 10, -169.7452,-1395.7577,3.3153))
  243.     {
  244.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  245.         DisablePlayerCheckpoint(playerid);
  246.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  247.         SetPlayerCheckpoint(playerid, -162.0952,-1412.2350,3.0394, 10);
  248.         GetPlayerPos(playerid, X, Y, Z);
  249.         GetPlayerFacingAngle(playerid, A);
  250.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  251.     }
  252.     IF(IsPlayerInRangeOfPoint(playerid, 10, -162.0952,-1412.2350,3.0394))
  253.     {
  254.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  255.         DisablePlayerCheckpoint(playerid);
  256.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  257.         SetPlayerCheckpoint(playerid, -192.4460,-1407.2355,3.9017, 10);
  258.         GetPlayerPos(playerid, X, Y, Z);
  259.         GetPlayerFacingAngle(playerid, A);
  260.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  261.     }
  262.     IF(IsPlayerInRangeOfPoint(playerid, 10, -192.4460,-1407.2355,3.9017))
  263.     {
  264.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  265.         DisablePlayerCheckpoint(playerid);
  266.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  267.         SetPlayerCheckpoint(playerid, -207.5008,-1421.8888,3.2155, 10);
  268.         GetPlayerPos(playerid, X, Y, Z);
  269.         GetPlayerFacingAngle(playerid, A);
  270.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  271.     }
  272.     IF(IsPlayerInRangeOfPoint(playerid, 10, -207.5008,-1421.8888,3.2155))
  273.     {
  274.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  275.         DisablePlayerCheckpoint(playerid);
  276.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  277.         SetPlayerCheckpoint(playerid, -226.2545,-1411.9092,6.5599, 10);
  278.         GetPlayerPos(playerid, X, Y, Z);
  279.         GetPlayerFacingAngle(playerid, A);
  280.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  281.     }
  282.     IF(IsPlayerInRangeOfPoint(playerid, 10, -226.2545,-1411.9092,6.5599))
  283.     {
  284.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  285.         DisablePlayerCheckpoint(playerid);
  286.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  287.         SetPlayerCheckpoint(playerid, -247.6317,-1427.6404,6.6805, 10);
  288.         GetPlayerPos(playerid, X, Y, Z);
  289.         GetPlayerFacingAngle(playerid, A);
  290.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  291.     }
  292.     IF(IsPlayerInRangeOfPoint(playerid, 10, -247.6317,-1427.6404,6.6805))
  293.     {
  294.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  295.         DisablePlayerCheckpoint(playerid);
  296.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  297.         SetPlayerCheckpoint(playerid, -263.1941,-1420.1913,9.3854, 10);
  298.         GetPlayerPos(playerid, X, Y, Z);
  299.         GetPlayerFacingAngle(playerid, A);
  300.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  301.     }
  302.     IF(IsPlayerInRangeOfPoint(playerid, 10, -263.1941,-1420.1913,9.3854))
  303.     {
  304.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  305.         DisablePlayerCheckpoint(playerid);
  306.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  307.         SetPlayerCheckpoint(playerid, -284.1987,-1431.4486,12.0138, 10);
  308.         GetPlayerPos(playerid, X, Y, Z);
  309.         GetPlayerFacingAngle(playerid, A);
  310.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  311.     }
  312.     IF(IsPlayerInRangeOfPoint(playerid, 10, -284.1987,-1431.4486,12.0138))
  313.     {
  314.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  315.         DisablePlayerCheckpoint(playerid);
  316.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  317.         SetPlayerCheckpoint(playerid, -300.6557,-1424.9337,14.0705, 10);
  318.         GetPlayerPos(playerid, X, Y, Z);
  319.         GetPlayerFacingAngle(playerid, A);
  320.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  321.     }
  322.     IF(IsPlayerInRangeOfPoint(playerid, 10, -300.6557,-1424.9337,14.0705))
  323.     {
  324.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  325.         DisablePlayerCheckpoint(playerid);
  326.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  327.         SetPlayerCheckpoint(playerid, -320.6297,-1431.7501,15.1514, 10);
  328.         GetPlayerPos(playerid, X, Y, Z);
  329.         GetPlayerFacingAngle(playerid, A);
  330.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  331.     }
  332.     IF(IsPlayerInRangeOfPoint(playerid, 10, -320.6297,-1431.7501,15.1514))
  333.     {
  334.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  335.         DisablePlayerCheckpoint(playerid);
  336.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  337.         SetPlayerCheckpoint(playerid, -330.9842,-1410.7192,14.1269, 10);
  338.         GetPlayerPos(playerid, X, Y, Z);
  339.         GetPlayerFacingAngle(playerid, A);
  340.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  341.     }
  342.     IF(IsPlayerInRangeOfPoint(playerid, 10, -330.9842,-1410.7192,14.1269))
  343.     {
  344.         NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
  345.         DisablePlayerCheckpoint(playerid);
  346.         PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
  347.         SetPlayerCheckpoint(playerid, -343.0883,-1369.3920,14.4816, 10);
  348.         GetPlayerPos(playerid, X, Y, Z);
  349.         GetPlayerFacingAngle(playerid, A);
  350.         Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
  351.     }
  352.     IF(IsPlayerInRangeOfPoint(playerid, 10, -343.0883,-1369.3920,14.4816))
  353.     {
  354.         NEW vehicleid = GetPlayerVehicleID(playerid);
  355.         DisablePlayerCheckpoint(playerid);
  356.         SendClientMessage(playerid, color_greey, "{00FF00}|FARM|: Congratulations successfully planted feet!");
  357.         SendClientMessage(playerid, color_puple,"{00FF00}|FARM|: wait until they deem frutod to harvest");
  358.         PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
  359.         SetVehicleToRespawn(vehicleid);
  360.         SetTimerEx("Terminou_Plantar", 2000, FALSE, "i", playerid);
  361.     }
  362.     RETURN 1;
  363. }
  364. forward Terminou_Plantar(playerid);
  365. public Terminou_Plantar(playerid){
  366.  
  367.     Pode_Colher[playerid] = TRUE;
  368.     SendClientMessage(playerid, color_puple,"{00FF00}|FARM|: the fruits grown and now you can reap!");
  369.     PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
  370.     RETURN 1;
  371. }
  372. NEW Mensagens[][] =
  373. {
  374.     "You want to be a farmer? use the command / fazendeiro",
  375.     "This server has a farm system by Takelot"
  376. };
  377. public Menssagens()
  378. {
  379.     NEW random2 = random(sizeof(RandomColors));
  380.     NEW randMSG = random(sizeof(Mensagens));
  381.     SendClientMessageToAll(RandomColors[random2], Mensagens[randMSG]);
  382. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement