Guest User

GOLDPOT SYSTEM BY SCRAT

a guest
May 31st, 2013
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 11.35 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <streamer>
  4.  
  5. new Float:GPPos[3], GoldPotFound=1, GoldPotLocation[50], GOLDPOTPK, GOLDPOTCP, GOLDPOTTIMER;
  6. new GOLDPOTTIME[2];
  7. enum GoldpotInfo
  8. {
  9.         Float:GPXPOS,
  10.         Float:GPYPOS,
  11.         Float:GPZPOS,
  12.         GPPosition[50]
  13. };
  14.  
  15. new Float:GPSPAWN[][GoldpotInfo] =
  16. {
  17.     // Positions, (X, Y, Z, Location)
  18.     {1937.4636,-2361.4460,21.1369, "Los Santos Airport"},
  19.     {1359.9862,1505.4540,45.2797, "Las Venturas Airport"},
  20.     {-1278.3353,49.4676,13.8755, "San Fierro Airport"},
  21.     {-2025.9376,83.8682,28.0160, "Fire Dept"},
  22.     {-1753.7069,885.7668,295.8750, "Big Pointy Building"},
  23.     {1835.5208,-1682.6647,12.9617, "Alhambra"},
  24.     {1918.9445,-1414.3654,13.1268, "Skate Park"},
  25.     {1881.8644,-1314.9628,14.0652, "Unfinished Building Near Skate Park"},
  26.     {2029.4133,-1404.1167,16.8243, "County General Hospital"},
  27.     {1971.5345,-1196.0419,17.4500, "Lake In A Park"},
  28.     {1415.4343,-810.5200,74.9087, "VINEWOOD"},
  29.     {1298.2969,-798.1028,83.7033, "Maddog's"},
  30.     {1285.6399,-1156.3510,23.8281, "Movie Stars"},
  31.     {811.2444,-1098.5168,25.9063, "Graveyard"},
  32.     {1087.9865,-922.7635,42.9619, "Los Santos Sex Shop"},
  33.     {1058.5283,-941.3829,42.5121, "Quite Humourous Comedy Club"},
  34.     {756.0792,-1261.4366,13.1194, "Tennis Court"},
  35.     {542.5836,-1292.3295,16.8007, "Grotti's"},
  36.     {475.5581,-1279.2805,16.0575, "Vinyl Countdown"},
  37.     {461.6343,-1500.9377,30.6217, "Los Santos Victim To Die For"},
  38.     {488.1684,-1733.6770,10.7457, "Verona Beach Pay 'n' Spray"},
  39.     {674.3853,-1867.1614,5.0312, "Beach GYM"},
  40.     {431.7024,-1751.3900,8.3387, "Son Of A Beach T-Shirts 'n' Shits"},
  41.     {386.9139,-2028.4971,7.3997, "Ferris Wheel"},
  42.     {1554.5275,-1675.6545,15.7660, "LSPD"},
  43.     {1786.7144,-1304.6896,13.1746, "Los Santos Flats"},
  44.     {2354.6982,-648.9710,127.6280, "Abandoned Wooden Shack"},
  45.     {2695.6931,-1704.7502,11.8438, "Los Santos Forum"},
  46.     {2231.4314,-2284.2407,14.3751, "Trailer Park"},
  47.     {2195.9836,-1969.6073,13.33861, "Los Santos Junkyard"},
  48.     {2495.3130,-1690.4086,14.2556, "CJ isn't Home!"},
  49.     {2309.6592,-1643.4934,14.3873, "Ten Green Bottles"},
  50.     {2071.0059,-1793.2654,13.1151, "First Barber Salon"},
  51.     {1786.2906,-1917.4558,12.9513, "Unity Station"},
  52.     {1842.2286,-1856.7734,12.9402, "Los Santos Bomb Shop"},
  53.     {1691.3992,-1972.1062,8.3836, "Tunnel Under Unity Station"},
  54.     {2421.6812,-1219.7576,25.0916, "The Pig Pen"},
  55.     {2454.4668,-1461.2080,23.5723, "Car Wash"},
  56.     {2409.7075,-1490.5160,23.5188, "Drive-Thru Cluckin' Bell"},
  57.     {2290.9382,-1527.8555,26.4476, "Basketball Court"},
  58.     {1544.4298,-1352.9421,329.4749, "Great View Over Los Santos"},
  59.     {1172.7122,-1323.3519,15.3758, "All Saints General Hospital"},
  60.     {1368.4368,-1279.1364,13.0646, "Los Santos Ammu-Nation"},
  61.     {655.4813,-565.3996,15.8988, "We Have Gas!"},
  62.     {701.6240,-520.7927,15.9082, "Mr. Grant's Bike Shed"},
  63.     {-62.1287,-1122.0255,0.8941, "We'll Dump Your Load"},
  64.     {-88.9836,-1565.2668,2.5977, "Camper Park"},
  65.     {-365.8894,-1428.4794,25.2871, "Helena Wankstein's Farm"},
  66.     {-89.1678,1378.1990,9.9968, "UFO Bar"},
  67.     {419.8001,1415.0613,8.5656, "Extraction Of Petroleum"},
  68.     {234.6878,1857.9501,16.9258, "Area 69"},
  69.     {219.9395,1822.8466,7.5225, "GTA SA Map"},
  70.     {393.7918,2477.1445,17.6411, "Abandoned Airport"},
  71.     {966.7471,2160.5139,10.3815, "Meat Factory"},
  72.     {1099.3290,1601.9183,12.1066, "DirtRing"},
  73.     {1171.6813,1350.9072,10.4971, "Bike School"},
  74.     {2096.2563,1285.9447,10.3773, "Obelisk"},
  75.     {2179.3452,1285.6652,42.0967, "Sphinx"},
  76.     {2325.0559,1283.3019,95.8557, "Pyramid"},
  77.     {2098.5833,1159.6077,11.2070, "Castle"},
  78.     {2027.2952,1008.4667,10.3953, "The Four Dragons"},
  79.     {1998.7495,1544.1276,13.8540, "Pirate Ship"},
  80.     {2192.3992,1676.6183,12.3672, "Caligula's"},
  81.     {2226.8938,1838.2239,10.3801, "Clowns Pocket"},
  82.     {2470.8655,1905.8854,9.4165, "Unfinished Casino Construction"},
  83.     {2634.0325,1824.1997,10.5797, "Las Venturas Chinese Stores"},
  84.     {2369.0376,1983.5864,10.3735, "Venturas Steaks"},
  85.     {2320.2668,2124.4951,32.3841, "Candy Suxx"},
  86.     {2506.2283,2121.0957,10.4144, "World Class Topless Girls"},
  87.     {2517.8235,2334.6921,10.3902, "Dick's Sounds"},
  88.     {2577.8293,2381.8379,17.8559, "Guitar Pool"},
  89.     {2932.8455,2119.3911,17.9667, "Oil Pipe (Sea)"},
  90.     {2017.6084,1917.1071,11.9014, "The Visage"},
  91.     {2086.3899,2074.8425,10.6182, "Las Venturas Sex Shop"},
  92.     {2127.4353,2379.3999,10.3837, "Emerald Isle"},
  93.     {2006.0173,2301.4419,10.3823, "Las Venturas Bomb Shop"},
  94.     {1693.8899,2221.5574,19.9481, "Steakhouse"},
  95.     {1657.6414,2189.8066,19.8165, "Four Big Wheels"},
  96.     {1383.0128,2184.5913,10.5971, "Home of The Bandits Stadium"},
  97.     {2090.1895,1515.5844,10.3757, "Royal Casino"},
  98.     {2451.4629,1299.5242,10.5688, "Weeding Chapel 24HR"},
  99.     {2200.8569,1394.8051,11.0625, "Auto Bahn"},
  100.     {-426.4739,2505.0479,124.3047, "Huge Cock"},
  101.     {-230.3798,2663.1609,62.1808, "Desert Chicken"},
  102.     {-844.3906,2745.9275,45.5455, "Tee Tee Motel"},
  103.     {-1305.1088,2491.9995,86.6352, "Aldea Malvada - The Lost Pueblo"},
  104.     {-1353.4595,2057.5054,52.8379, "Desert Bait Shop"},
  105.     {-595.0970,2018.1423,60.1794, "DAM"},
  106.     {-868.2958,2308.5347,160.6376, "San Andreas Biggest Ramp"},
  107.     {-127.6189,2258.2041,27.9226, "Body Bags"},
  108.     {-347.1075,1607.5189,75.8579, "Huge Dish"},
  109.     {-420.5294,1369.4535,12.5537, "Cave"},
  110.     {-92.1433,1188.4261,19.3069, "Desert Bowling"},
  111.     {110.4773,1105.7754,13.1785, "Drive-in Cinema"},
  112.     {589.9595,873.0225,-42.9249, "Quarry"},
  113.     {-792.6751,1627.5806,26.7337, "DAM Camper Park"},
  114.     {-795.1779,1557.0668,26.7001, "Desert Castle"},
  115.     {-734.2950,1546.2085,38.5811, "Desert Ruins"},
  116.     {-860.3210,1530.1660,34.1077, "The Smokin' Beef Grill"},
  117.     {-1465.8965,2637.4116,76.3252, "El Quebrados Water Deposit"},
  118.     {-1514.8104,2519.5940,55.5796, "El Quebrados Medical Center"},
  119.     {-1392.6355,2643.5117,55.4078, "El Quebrados Sheriff"},
  120.     {-2184.9448,2413.0676,4.9013, "Captain School"},
  121.     {-2495.9158,2363.1543,13.6891, "Because We Care...Phat Clothing"},
  122.     {-2665.1262,1594.9802,217.2739, "No Easter Eggs"},
  123.     {-2544.1926,1227.8944,36.9986, "Actual Piece Of Cable"},
  124.     {-2624.8486,1412.3381,6.6632, "Jizzy's"},
  125.     {-1680.7772,1362.7539,7.8828, "Pier 69"},
  126.     {-1644.8544,1205.3395,32.4771, "Otto's"},
  127.     {-1385.7150,672.0509,2.6315, "Under A Bridge (SF)"},
  128.     {-1959.4122,700.1752,46.1319, "Zombotech"},
  129.     {-2243.5339,739.3001,49.0057, "Chinatown"},
  130.     {-2442.5469,754.7700,34.7334, "Supa Save"},
  131.     {-2438.4993,495.3089,29.9260, "San Andreas Federal Mint"},
  132.     {-2314.4526,101.2893,34.9486, "Baseball Field"},
  133.     {-2242.1243,128.9496,34.8966, "Zero RC Shop"},
  134.     {-2270.1965,-155.6732,34.8827, "Cobra Marital Arts"},
  135.     {-2184.3953,-264.4480,40.2779, "San Fierro Warehouse"},
  136.     {-2026.4893,-101.9039,34.7350, "Learn How To Drive"},
  137.     {-2157.6765,-400.2065,35.0290, "Corvin Stadium"},
  138.     {-1790.8474,567.7253,332.3959, "Highest San Fierro Building"},
  139.     {-1286.4249,507.4871,17.8079, "Military Ship"},
  140.     {-2471.6221,1549.7582,33.2273, "Ship Cabin"},
  141.     {-2482.6108,-286.3192,40.0976, "Golf Court"},
  142.     {-2082.2151,-862.9426,66.4372, "Five Identical Buildings (SF)"},
  143.     {-1846.8195,-1708.4432,41.1139, "Angel Pine Junkyard"},
  144.     {-2258.4678,-1742.6514,487.0852, "Chilliad"},
  145.     {-2815.8674,-1521.6892,140.8438, "Chilliad Hill House"},
  146.     {-1995.9794,-1558.0986,84.9481, "Chilliad Hole"},
  147.     {-2050.0474,-2338.9712,40.4652, "Angel Pine Sawmill"},
  148.     {-2165.3091,-2416.9666,30.3205, "Lovin' A Loan"},
  149.     {-2293.9902,-2448.8823,25.2630, "Angel Pine Hobostack"},
  150.     {-799.8579,-2259.4114,39.4541, "Horse Shoes"},
  151.     {-739.4749,-1990.4443,9.5690, "Shitty Lake"},
  152.     {2224.4690,-1262.5192,23.4685, "CJ's First Spawn"},
  153.     {2101.6265,-1649.0497,12.9783, "CJ's First Tag Mission"},
  154.     {-2406.6223,326.0979,34.7434, "Vank Hoff In The Park"},
  155.     {154.2135,-1945.2555,4.2731, "Lighthouse"},
  156.     {421.0309,-1314.9159,32.3516, "Candy Suxx Billboard"},
  157.     {-1989.8995,1117.8409,54.4688, "Where's The Priest?"},
  158.     {-1809.6421,-210.5458,24.5313, "Harry Plums Wholesale Fruit"},
  159.     {-2767.1743,786.2155,52.3440, "Tuff Nut Donuts"},
  160.     {2498.2488,2773.4836,10.3855, "Military Fuels"},
  161.     {732.8908,-1341.5129,14.4291, "Interglobal TV"},
  162.     {823.0460,-1365.3257,-0.9459, "Market Station"},
  163.     {1128.8400,-1488.6097,22.3362, "Verona Mall"},
  164.     {2441.0557,-1653.7570,26.2929, "Breakable Bridge (LS)"},
  165.     {2834.6379,-2434.8826,14.1733, "Ship Docked In Los Santos"},
  166.     {2851.5535,-1532.3398,10.6553, "Sprunk Incorporated"},
  167.     {2808.4189,-1176.2007,24.9234, "Cannon In A House"},
  168.     {2644.7964,-1459.2537,15.8071, "Sewer Tunnel"},
  169.     {1117.8289,-2036.8716,78.1645, "Los Santos Observatory"},
  170.     {-1605.3304,711.0455,13.4393, "SFPD"},
  171.     {-1942.0330,277.1327,35.4739, "Wang Cars"},
  172.     {-2026.4648,156.5116,28.5871, "Doherty Garage"},
  173.     {-1968.7589,110.6265,27.4519, "San Fierro Station"},
  174.     {-1827.2380,42.3856,14.6888, "Solarin Industries"},
  175.     {-1536.7402,483.1094,7.1797, "Easter Basin Naval Station"},
  176.     {-338.4648,2218.3623,42.0909, "DAM Cemetery"},
  177.     {-35.7158,2349.9453,23.9113, "Snake Farm"},
  178.     {1288.8795,271.3768,19.1206, "Inside Track"},
  179.     {103.0110,-294.1638,1.1473, "Fleichberg"},
  180.     {1271.8375,295.0602,20.6563, "BIOWASTE"},
  181.     {1040.0636,-1343.0978,22.1932, "Donut Ring"},
  182.     {1277.5110,370.6000,19.1218, "PAPERCUTS - Let Us Fill Your Office"},
  183.     {1351.2240,349.2023,19.9189, "BIOENGINEERING - Getting OUR hands in YOUR genes"}
  184. };
  185.  
  186.  
  187. public OnFilterScriptInit()
  188. {
  189.     GOLDPOTTIMER = SetTimer("GoldPot", 60000, false);
  190.     return 1;
  191. }
  192.  
  193. forward GoldPot();
  194. public GoldPot()
  195. {
  196.     new string[255];
  197.     if(!GoldPotFound)
  198.     {
  199.         SendClientMessageToAll(-1, "No one found the goldpot!");
  200.         GoldPotFound = 1;
  201.         DestroyPickup(GOLDPOTPK);
  202.         DestroyDynamicCP(GOLDPOTCP);
  203.         GoldPot();
  204.        
  205.     }
  206.     else if(GoldPotFound)
  207.     {
  208.         GoldPotFound = 0;
  209.         new gprand = random(sizeof(GPSPAWN));
  210.         GPPos[0] = GPSPAWN[gprand][GPXPOS];
  211.         GPPos[1] = GPSPAWN[gprand][GPYPOS];
  212.         GPPos[2] = GPSPAWN[gprand][GPZPOS];
  213.         format(GoldPotLocation, sizeof(GoldPotLocation), "%s", GPSPAWN[gprand][GPPosition]);
  214.         format(string, sizeof(string), "Find the goldpot worth 10 score and 50 000$. Hint: %s!", GoldPotLocation);
  215.         printf("GOLDPOT LOCATION %s.",GoldPotLocation);
  216.         SendClientMessageToAll(-1, string);
  217.         GOLDPOTPK = CreatePickup(1550, 2, GPPos[0], GPPos[1], GPPos[2], -1);
  218.         GOLDPOTCP = CreateDynamicCP(GPPos[0], GPPos[1], GPPos[2],3,-1,-1,-1,20);
  219.         GOLDPOTTIME[0] = GetTickCount();
  220.         GOLDPOTTIMER = SetTimer("GoldPot", 600000, false);
  221.     }
  222.     return 1;
  223. }
  224.  
  225. CMD:goldpot(playerid,params[])
  226. {
  227.     new string[255];
  228.     if(!GoldPotFound)
  229.     {
  230.         GOLDPOTTIME[1] = GetTickCount();
  231.         new Float:timeresult = GOLDPOTTIME[1] - GOLDPOTTIME[0];
  232.         format(string, sizeof(string), "The goldpot hasn't been found in %.2f seconds!. Hint: %s!", timeresult/1000,GoldPotLocation);
  233.     }
  234.     if(GoldPotFound) format(string, sizeof(string), "The last goldpot was found. Wait please.");
  235.     return SendClientMessage(playerid, -1, string);
  236. }
  237.  
  238. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  239. {
  240.     if(checkpointid == GOLDPOTCP)
  241.     {
  242.         new string[180], pname[24];
  243.         GetPlayerName(playerid, pname, 24);
  244.         GOLDPOTTIME[1] = GetTickCount();
  245.         new Float:timeresult = GOLDPOTTIME[1] - GOLDPOTTIME[0];
  246.         format(string, sizeof(string), "%s has found the goldpot in %.2f seconds!. Reward: 10 Score + 50000$!(%s)", pname, timeresult/1000,GoldPotLocation);
  247.         SendClientMessageToAll(-1, string);
  248.         SendClientMessage(playerid, -1, "You have found the goldpot! Reward 10 score and 50 000$");
  249.         SetPlayerScore(playerid, GetPlayerScore(playerid) + 10);
  250.         GivePlayerMoney(playerid, 50000);
  251.         GoldPotFound = 1;
  252.         DestroyPickup(GOLDPOTPK);
  253.         DestroyDynamicCP(GOLDPOTCP);
  254.         KillTimer(GOLDPOTTIMER);
  255.         GOLDPOTTIMER = SetTimer("GoldPot", 120000, false);
  256.     }
  257.     return 1;
  258. }
Advertisement
Add Comment
Please, Sign In to add comment