How to FIX THIS ?
#1

Hey i got some issues with pickups. When i pick up property pickup it says i found the moneybag.
So i made a post before 2 days and i was told to change re assign the moneybagpickupid.
But I don't know how to... please help here is the moneybag script!

Quote:

#include <a_samp>

enum mbinfo
{
Float:XPOS,
Float:YPOS,
Float:ZPOS,
Position[50]
};

new Float:MBSPAWN[][mbinfo] =
{
// Positions, (X, Y, Z, Location)
{713.073852, 912.842224, -19.096578, "The Quarry"},
{688.145507, 844.974914, -28.631895, "The Quarry"},
{586.370788, 913.020202, -34.194843, "The Quarry"},
{503.419708, 970.914550, -24.997589, "The Quarry"},
{499.296356, 971.732788, -25.047336, "The Quarry"},
{458.502136, 891.120666, -27.374114, "The Quarry"},
{628.248901, 735.500732, -0.903092, "The Quarry"},
{627.924438, 1046.961303, 25.122577, "The Quarry"},
{792.460510, 915.044189, 20.112213, "The Quarry"},
{320.508636, 848.626281, 19.967500, "The Quarry"},
{623.156188, 892.809875, -41.102825, "The Quarry"},
{229.331573, 1478.390502, 10.151371, "Green Palms"},
{152.056015, 1447.338256, 10.156622, "Green Palms"},
{133.937881, 1377.117065, 10.158605, "Green Palms"},
{205.768768, 1352.408081, 10.151306, "Green Palms"},
{210.495468, 1395.340332, 10.151283, "Green Palms"},
{215.108322, 1467.936157, 14.921875, "Green Palms"},
{222.136520, 1424.068847, 10.585937, "Green Palms"},
{95.363838, 1831.129028, 17.205287, "Area 69"},
{189.325698, 1940.272949, 17.213102, "Area 69"},
{193.302978, 1940.295654, 17.212646, "Area 69"},
{261.569244, 1807.425537, 25.498508, "Area 69"},
{201.875762, 1873.929809, 12.774854, "Area 69"},
{238.924987, 1863.955078, 11.460937, "Area 69"},
{221.148391, 1822.212890, 7.531250, "Area 69"},
{245.811523, 1813.676025, 4.710937, "Area 69"},
{257.617523, 1819.045043, 1.007812, "Area 69"},
{280.195648, 1840.170532, 11.534780, "Area 69"},
{282.369171, 1874.492065, 8.757812, "Area 69"},
{266.978424, 1858.773071, 8.757812, "Area 69"},
{262.194854, 1886.633789, -30.390625, "Area 69"},
{268.940002, 1883.556152, -30.093750, "Area 69"},
{268.277374, 1891.600708, -12.862023, "Area 69"},
{268.972656, 1876.503906, -3.470956, "Area 69"},
{275.735778, 1892.228881, 8.437500, "Area 69"},
{246.438491, 1830.403930, 12.210659, "Area 69"},
{134.512237, 1952.987426, 18.978763, "Area 69"},
{-41.510822, 1178.722290, 18.961349, "Fort Carson"},
{2.213922, 1119.721435, 19.450517, "Fort Carson"},
{17.874195, 1076.159057, 19.804994, "Fort Carson"},
{-95.816307, 1164.927001, 19.312730, "Fort Carson"},
{-100.357772, 1127.539672, 19.323959, "Fort Carson"},
{-117.773254, 1132.638061, 19.326152, "Fort Carson"},
{-190.864791, 1218.766357, 19.306653, "Fort Carson"},
{-218.729446, 1147.502807, 19.328531, "Fort Carson"},
{-378.680541, 1103.303466, 19.314443, "Fort Carson"},
{-312.767395, 1175.458740, 19.307266, "Fort Carson"},
{-209.111099, 1216.520629, 23.436161, "Fort Carson"},
{-170.258102, 1176.971801, 24.155366, "Fort Carson"},
{-172.726379, 1182.572753, 26.504249, "Fort Carson"},
{-824.523559, 1444.919677, 13.547593, "Las Barrancas"},
{-811.227539, 1479.601074, 26.136028, "Las Barrancas"},
{-733.456970, 1553.795654, 39.189163, "Las Barrancas"},
{-737.410278, 1593.716186, 26.656929, "Las Barrancas"},
{-287.109222, 2687.127441, 65.852340, "Las Payasadas"},
{-268.482818, 2667.310546, 62.670055, "Las Payasadas"},
{-282.033843, 2651.087402, 67.323928, "Las Payasadas"},
{-235.506256, 2826.033935, 61.760990, "Las Payasadas"},
{123.295402, 2427.276123, 16.638261, "Verdant Meadows"},
{152.007369, 2417.473388, 19.140531, "Verdant Meadows"},
{209.578689, 2415.689697, 16.322700, "Verdant Meadows"},
{237.976455, 2432.690185, 16.626625, "Verdant Meadows"},
{276.434844, 2430.887695, 16.041940, "Verdant Meadows"},
{313.228027, 2415.748046, 19.511663, "Verdant Meadows"},
{154.106018, 2630.396240, 16.041749, "Verdant Meadows"},
{115.394462, 2631.614501, 15.986257, "Verdant Meadows"},
{104.371681, 2582.203613, 16.044742, "Verdant Meadows"},
{14.670138, 2560.055419, 15.932084, "Verdant Meadows"},
{9.903661, 2435.500732, 16.019382, "Verdant Meadows"},
{-2452.078125, 2438.356933, 14.555831, "Bayside"},
{-2417.809570, 2456.555908, 25.779113, "Bayside"},
{-2406.699462, 2469.222656, 12.183320, "Bayside"},
{-2415.591552, 2386.210205, 7.998282, "Bayside"},
{-2386.701904, 2398.892578, 8.845354, "Bayside"},
{-2407.274902, 2477.111816, 11.345425, "Bayside"},
{-2403.085449, 2553.951904, 23.601562, "Bayside"},
{-2286.216552, 2572.171142, 23.416145, "Bayside"},
{-2624.168212, 2245.396972, 6.268455, "Bayside"},
{-2551.672851, 2432.413330, 18.866594, "Bayside"},
{-2293.487060, 2225.002685, 4.982191, "Bayside"},
{-2578.585693, 2520.823730, 21.721471, "Bayside"},
{-2497.177978, 2455.601562, 17.332534, "Bayside"},
{-2299.505859, 2277.234619, 4.978750, "Bayside"},
{-2353.547119, 2430.278320, 7.510148, "Bayside"},
{377.058685, -126.040382, 1.282783, "Blueberry"},
{331.945190, -21.335258, 8.999382, "Blueberry"},
{270.666198, 25.962350, 7.423792, "Blueberry"},
{269.469726, -39.207118, 2.076274, "Blueberry"},
{249.126205, -55.748535, 2.778613, "Blueberry"},
{200.529525, -2.403444, 1.585840, "Blueberry"},
{79.888191, -172.170288, 3.240008, "Blueberry"},
{90.263679, -196.305435, 1.484375, "Blueberry"},
{307.548217, -256.133117, 1.583575, "Blueberry"},
{130.356811, -65.668479, 1.578125, "Blueberry"},
{201.947799, -107.787826, 1.552092, "Blueberry"},
{251.443710, -59.984920, 5.882812, "Blueberry"},
{338.868713, 39.111991, 6.514575, "Blueberry"},
{233.187500, 88.724472, 3.707660, "Blueberry"},
{271.035064, -325.480102, 4.109173, "Blueberry"},
{258.287322, -91.798759, 6.548583, "Blueberry"},
{660.309570, -515.073425, 22.836296, "Dillimore"},
{681.892456, -471.186981, 24.570465, "Dillimore"},
{720.187500, -460.116394, 23.195312, "Dillimore"},
{766.745727, -565.935180, 18.013334, "Dillimore"},
{766.601135, -565.742553, 18.013334, "Dillimore"},
{795.740600, -498.457305, 18.013332, "Dillimore"},
{806.729309, -644.110595, 16.335937, "Dillimore"},
{837.977600, -618.451599, 16.427936, "Dillimore"},
{697.977600, -502.530029, 20.336296, "Dillimore"},
{2252.387695, -71.207305, 31.594974, "Palimino Creek"},
{2256.675292, -51.222541, 33.039546, "Palimino Creek"},
{2280.761474, -43.499469, 33.915302, "Palimino Creek"},
{2331.433349, -16.148464, 29.984375, "Palimino Creek"},
{2307.091796, 42.845218, 26.484375, "Palimino Creek"},
{2312.534423, 81.270088, 34.412147, "Palimino Creek"},
{2237.241210, -146.453750, 25.870410, "Palimino Creek"},
{2294.017333, -133.607147, 28.153959, "Palimino Creek"},
{2290.864501, -125.560646, 31.281974, "Palimino Creek"},
{2494.198486, 84.268798, 26.484375, "Palimino Creek"},
{2522.718505, -35.541027, 27.843750, "Palimino Creek"},
{2371.754638, 166.031631, 28.441642, "Palimino Creek"},
{2521.830566, 147.489349, 26.660923, "Palimino Creek"},
{2503.659667, 138.658645, 26.476562, "Palimino Creek"},
{2385.197021, 132.599624, 26.477228, "Palimino Creek"},
{2497.073974, 73.162178, 26.484375, "Palimino Creek"},
{1113.000366, -298.941436, 79.273048, "Hilltop Farms"},
{1145.276123, -319.449951, 68.736564, "Hilltop Farms"},
{1139.270874, -279.303375, 68.293548, "Hilltop Farms"},
{1109.191650, -254.074951, 73.178703, "Hilltop Farms"},
{1074.967651, -290.027832, 76.994865, "Hilltop Farms"},
{1045.733276, -292.704284, 77.359375, "Hilltop Farms"},
{1017.502319, -291.644531, 77.359375, "Hilltop Farms"},
{1025.220092, -286.122772, 73.993080, "Hilltop Farms"},
{1008.152404, -361.344543, 73.992187, "Hilltop Farms"},
{1031.137329, -286.081237, 73.992187, "Hilltop Farms"},
{-91.739074, 47.309322, 3.117187, "Blueberry Acres"},
{-59.916896, 110.778358, 3.117187, "Blueberry Acres"},
{-21.062276, 101.820167, 3.117187, "Blueberry Acres"},
{-39.467891, 54.310203, 3.117187, "Blueberry Acres"},
{-57.822875, 58.630420, 12.634796, "Blueberry Acres"},
{6.610152, -116.727790, 0.827577, "Blueberry Acres"},
{-234.935729, -49.896484, 3.117187, "Blueberry Acres"},
{-396.805908, -1426.215209, 38.644241, "Flint Range"},
{-365.578216, -1413.950805, 29.640625, "Flint Range"},
{-364.751220, -1434.614501, 25.726562, "Flint Range"},
{-584.598876, -1482.920043, 11.257370, "Flint Range"},
{-558.555603, -1289.688232, 24.061843, "Flint Range"},
{-257.378387, -1502.086059, 6.142509, "Flint Range"},
{-329.254211, -1537.986083, 14.820620, "Flint Range"},
{-370.188598, -1416.738281, 25.726562, "Flint Range"},
{-468.467102, -1423.658813, 17.497291, "Flint Range"},
{-366.230377, -1425.508422, 36.910018, "Flint Range"},
{-438.425720, -1307.287841, 34.957294, "Flint Range"},
{-326.334747, -1312.265869, 9.666571, "Flint Range"},
{-2508.313232, -675.049499, 139.320312, "Missionary Hill"},
{-2528.568359, -700.439453, 141.788848, "Missionary Hill"},
{-2438.275146, -464.318084, 91.305053, "Missionary Hill"},
{-2543.994384, -783.435424, 69.258705, "Missionary Hill"},
{-2600.115478, -547.044921, 86.723999, "Missionary Hill"},
{-2322.930664, -655.598815, 107.419876, "Missionary Hill"},
{-2324.206054, -683.263916, 104.464118, "Missionary Hill"},
{-2394.915283, -468.217041, 87.153312, "Missionary Hill"},
{-2631.078613, -596.495971, 90.808830, "Missionary Hill"},
{-2432.825439, -391.364898, 69.389305, "Missionary Hill"},
{-2617.927001, -749.242065, 74.848922, "Missionary Hill"},
{-2175.949951, -2417.699218, 34.296875, "Angel Pine"},
{-2161.742919, -2453.351562, 37.592113, "Angel Pine"},
{-2147.736572, -2461.206787, 30.851562, "Angel Pine"},
{-2090.979492, -2469.472900, 33.924186, "Angel Pine"},
{-2053.039306, -2544.468261, 31.066806, "Angel Pine"},
{-2132.012939, -2433.635986, 39.040298, "Angel Pine"},
{-2182.593994, -2428.734375, 35.523437, "Angel Pine"},
{-2224.829833, -2396.499511, 35.533672, "Angel Pine"},
{-2243.295654, -2359.313720, 30.750513, "Angel Pine"},
{-1064.526367, -1202.956298, 136.825164, "The Farm"},
{-1073.703247, -1236.239135, 129.218750, "The Farm"},
{-960.019836, -969.289123, 136.249679, "The Farm"},
{-1178.073120, -1139.615356, 129.218750, "The Farm"},
{-1086.143554, -1304.293945, 129.218750, "The Farm"},
{-1099.003295, -971.934814, 129.218750, "The Farm"},
{-1062.486328, -913.190063, 129.211929, "The Farm"},
{-1004.356140, -1013.866821, 129.218750, "The Farm"},
{-1033.648925, -1068.210327, 129.218750, "The Farm"},
{-1019.635437, -1153.692138, 129.218750, "The Farm"},
{-1026.010375, -1183.257690, 129.218750, "The Farm"},
{-1007.072387, -1296.862426, 132.661285, "The Farm"},
{-1124.512817, -1222.314208, 129.218750, "The Farm"},
{-1087.444824, -1677.984130, 76.373939, "Leafy Hallows"},
{-1087.494018, -1678.885498, 76.373939, "Leafy Hallows"},
{-1091.211059, -1663.834472, 76.367187, "Leafy Hallows"},
{-1108.562622, -1634.623657, 80.057617, "Leafy Hallows"},
{-1078.178222, -1607.183349, 76.367187, "Leafy Hallows"},
{-1130.027343, -1606.987304, 76.367187, "Leafy Hallows"},
{-1112.752685, -1621.049194, 86.261589, "Leafy Hallows"},
{-1097.599121, -1627.398681, 76.367187, "Leafy Hallows"},
{-946.533935, -1746.916137, 76.381385, "Leafy Hallows"},
{-927.683105, -1701.916503, 77.025894, "Leafy Hallows"},
{-923.776733, -1757.801513, 75.444259, "Leafy Hallows"},
{-905.625366, -1730.898193, 78.139099, "Leafy Hallows"},
{-907.789489, -1669.016723, 92.697944, "Leafy Hallows"},
{2556.437744, -644.786804, 137.252746, "North Rock"},
{2514.413818, -716.559753, 101.872634, "North Rock"},
{2443.473388, -657.824401, 121.906684, "North Rock"},
{2612.934814, -497.000335, 78.922164, "North Rock"},
{2657.899414, -602.413452, 84.188896, "North Rock"},
{2683.218017, -516.679077, 65.786819, "North Rock"},
{2627.179199, -666.909179, 128.962661, "North Rock"},
{2759.122314, -633.098876, 60.327945, "North Rock"},
{2356.232910, -558.502868, 120.259140, "North Rock"},
{2558.949218, -523.134826, 86.272521, "North Rock"},
{-1012.700317, -754.431518, 32.007812, "Easter Bay Chemicals"},
{-1095.468139, -629.071044, 34.089599, "Easter Bay Chemicals"},
{-1109.042358, -601.289489, 34.089599, "Easter Bay Chemicals"},
{-1074.046508, -600.883239, 34.089599, "Easter Bay Chemicals"},
{-1112.463256, -748.833557, 32.007812, "Easter Bay Chemicals"},
{-996.942810, -720.715209, 35.937500, "Easter Bay Chemicals"},
{-987.252502, -716.223449, 35.901714, "Easter Bay Chemicals"},
{-1057.215332, -758.628417, 37.171875, "Easter Bay Chemicals"},
{-1127.549194, -701.471435, 32.007812, "Easter Bay Chemicals"},
{-973.345092, -635.038330, 32.007812, "Easter Bay Chemicals"},
{-1099.870605, -696.740661, 32.351562, "Easter Bay Chemicals"},
{-1057.206665, -634.323059, 35.493179, "Easter Bay Chemicals"},
{-1017.676330, -704.239746, 32.007812, "Easter Bay Chemicals"},
{-1525.973999, 2652.515136, 59.711399, "El Quebrados"},
{-1507.893920, 2626.360107, 59.233432, "El Quebrados"},
{-1470.498413, 2554.702636, 55.835937, "El Quebrados"},
{-1579.125488, 2641.298095, 55.835937, "El Quebrados"},
{-1521.946166, 2709.298339, 55.835937, "El Quebrados"},
{-828.082336, 2661.674560, 104.945419, "Valle Ocultado"},
{-835.934020, 2659.769775, 96.975189, "Valle Ocultado"},
{-831.431640, 2695.995361, 53.576766, "Valle Ocultado"},
{-803.072448, 2695.158203, 67.962074, "Valle Ocultado"},
{-799.726013, 2704.947265, 47.416099, "Valle Ocultado"},
{-788.210693, 2694.006103, 48.357761, "Valle Ocultado"},
{-384.209350, 2206.028564, 45.671134, "Ghost Town"},
{-417.697753, 2246.862548, 42.429687, "Ghost Town"},
{-384.358673, 2206.287841, 45.671134, "Ghost Town"},
{-375.438262, 2241.879882, 47.126880, "Ghost Town"},
{-371.937103, 2266.688964, 42.484375, "Ghost Town"},
{-395.177276, 2246.250000, 50.119434, "Ghost Town"},
{-324.652770, 2216.008789, 44.212184, "Ghost Town"},
{-439.359222, 2219.759033, 47.228851, "Ghost Town"},
{2057.4861, 1584.6555, 11.3860, "Las Venturas Strip"},
{1978.9744, 1341.9728, 12.1679, "The High Roller"},
{1952.7090, 1342.7772, 15.3672, "The High Roller"},
{1955.8152, 1343.6718, 10.8203, "The High Roller"},
{2000.8960, 1526.6355, 14.6172, "Pirate Ship LV"},
{2019.2856, 1933.6051, 12.3413, "The Visage"},
{1990.0363, 1804.0670, 11.9658, "The Visage"},
{1884.6063, 1916.0862, 121.3125, "The Visage"},
{1964.7000, 1918.6570, 130.9375, "The Visage"},
{2004.7155, 1985.7189, 121.3125, "The Visage"},
{2001.4707, 1854.2504, 122.0156, "The Visage"},
{2001.9431, 1913.6509, 40.3516, "The Visage"},
{2118.4597, 2403.6187, 23.6016, "Emerald Isle"},
{2195.2678, 2400.8367, 29.1528, "Emerald Isle"},
{2093.5798, 2416.2209, 74.5786, "Emerald Isle"},
{2059.2659, 2423.4236, 150.4766, "Emerald Isle"},
{2119.2192, 2379.5447, 10.8203, "Emerald Isle"},
{2070.9280, 2365.0264, 23.6016, "Emerald Isle"},
{2064.6958, 2424.1499, 41.1690, "Emerald Isle"},
{2117.9751, 2416.6057, 45.2188, "Emerald Isle"},
{2139.9512, 2291.1326, 11.7422, "Emerald Isle"},
{1902.9260, 2232.2266, 11.1250, "Mental Clinic LV"},
{1897.6128, 2197.0178, 18.4844, "Mental Clinic LV"},
{1874.5250, 2213.0166, 18.4844, "Mental Clinic LV"},
{1849.5913, 2232.1895, 11.1250, "Mental Clinic LV"},
{1863.6892, 2189.9202, 11.1250, "Mental Clinic LV"},
{1486.6572, 2229.5481, 11.8984, "Baseball Stadium LV"},
{1483.3932, 2238.3386, 11.8984, "Baseball Stadium LV"},
{1382.5701, 2184.2664, 11.0234, "Baseball Stadium LV"},
{1394.4053, 2166.0701, 9.7578, "Baseball Stadium LV"},
{1298.6896, 2112.0710, 11.0234, "Baseball Stadium LV"},
{1679.7852, 1745.1682, 10.8248, "LV Airport"},
{1638.6257, 1627.9901, 14.8222, "LV Airport"},
{1645.9849, 1633.1378, 14.8222, "LV Airport"},
{1604.2371, 1458.0471, 10.8278, "LV Airport"},
{1605.2430, 1164.9768, 10.8125, "LV Airport"},
{1318.7423, 1250.7267, 10.8203, "LV Airport"},
{1267.1241, 1350.0719, 10.8130, "LV Airport"},
{1042.4901, 1542.7211, 5.8203, "Dirt Ring"},
{1113.4955, 1596.2367, 12.5469, "Dirt Ring"},
{1072.3939, 1594.8151, 5.8203, "Dirt Ring"},
{1028.9910, 1676.6599, 5.8203, "Dirt Ring"},

{2100.4465, 1158.6725, 11.6484, "Come-A-Lot"},
{2188.3101, 1122.2263, 12.6538, "Come-A-Lot"},
{2152.0249, 1138.5919, 7.0128, "Come-A-Lot"},
{2098.6216, 1159.8179, 24.5625, "Come-A-Lot"},
{2246.0403, 1042.1655, 48.2188, "Come-A-Lot"},
{2237.6792, 1133.2946, 49.0947, "Come-A-Lot"},
{2311.0420, 1139.2097, 79.5546, "Come-A-Lot"},
{2177.1208, 1064.9799, 79.5547, "Come-A-Lot"},
{2197.7322, 1106.0377, 26.7065, "Come-A-Lot"},
{2270.7727, 1047.3269, 10.8203, "Come-A-Lot"},
{2219.7366, 1048.7021, 10.8203, "Come-A-Lot"},
{2226.0862, 1843.0712, 10.8203, "Clowns Pocket"},
{2135.7227, 1841.8491, 10.6797, "Clowns Pocket"},
{2300.6162, 1870.7238, 10.8203, "Clowns Pocket"},
{2329.3118, 1872.4010, 16.4524, "Clowns Pocket"},
{2203.7151, 1832.4640, 19.0567, "Clowns Pocket"},
{2238.2092, 1837.3932, 17.8902, "Clowns Pocket"},
{2329.2593, 1817.7518, 16.4524, "Clowns Pocket"},
{2196.0115, 1665.4771, 12.3672, "Caligulas's Casino"},
{2266.5854, 1678.5103, 94.9219, "Caligulas's Casino"},
{2265.7593, 1617.2131, 94.9219, "Caligulas's Casino"},
{2243.3774, 1628.7339, 49.5938, "Caligulas's Casino"},
{2230.4663, 1629.7500, 20.3906, "Caligulas's Casino"},
{2227.7048, 1606.6213, 20.3906, "Caligulas's Casino"},
{2143.6028, 1728.0526, 20.3906, "Caligulas's Casino"},
{2134.9475, 1722.2670, 11.0533, "Caligulas's Casino"},
{2115.4839, 1691.0475, 10.8203, "Caligulas's Casino"},
{2116.8125, 1683.0906, 13.0060, "Caligulas's Casino"},
{2172.4221, 1514.9611, 10.8203, "Royal Casino"},
{2092.7207, 1454.8622, 35.4844, "Royal Casino"},
{2148.4133, 1501.0938, 26.7913, "Royal Casino"},
{2178.3040, 1456.7284, 30.3955, "Royal Casino"},
{2327.6521, 1521.1895, 44.7217, "Car Parking LV"},
{2333.8774, 1384.5132, 42.8203, "Car Parking LV"},
{2320.7083, 1385.8893, 44.5375, "Car Parking LV"},
{2257.9063, 1395.9688, 43.9128, "Car Parking LV"},
{2625.9011, 1724.9092, 11.0234, "ChinaTown LV"},
{2622.9746, 1716.6317, 11.0234, "ChinaTown LV"},
{2624.9678, 1823.4618, 11.0161, "ChinaTown LV"},
{2591.3633, 1899.5321, 11.0312, "ChinaTown LV"},
{2606.5210, 1891.7266, 11.0234, "ChinaTown LV"},
{2547.4053, 1855.4878, 30.6641, "ChinaTown LV"},
{2521.4175, 1827.4315, 22.4558, "ChinaTown LV"},
{2631.0769, 1830.1805, 25.1286, "ChinaTown LV"},
{2675.5471, 1663.3021, 10.8203, "ChinaTown LV"},
{2675.5288, 1625.5670, 11.0234, "ChinaTown LV"},
{2663.8096, 1942.1663, 11.0234, "ChinaTown LV"},
{2556.9653, 2101.8018, 10.8153, "Ammunation LV"},
{2577.2847, 2081.2444, 10.8130, "Ammunation LV"},
{2548.7295, 2080.5671, 15.6720, "Ammunation LV"},
{2196.8867, 940.2357, 10.8203, "Ammunation LV"},
{2165.6108, 946.2772, 15.6720, "Ammunation LV"},
{2212.1873, 946.2212, 15.6720, "Ammunation LV"},
{2636.4355, 2328.5186, 10.9219, "V-Rock Hotel"},
{2580.9785, 2356.8162, 17.8203, "V-Rock Hotel"},
{2559.3376, 2288.4656, 11.0625, "V-Rock Hotel"},
{1457.0092, 2773.9827, 10.8203, "Golf Club LV"},
{1487.5740, 2773.8330, 10.8203, "Golf Club LV"},
{1492.9858, 2773.4377, 10.8203, "Golf Club LV"},
{1365.9622, 2752.9841, 10.8053, "Golf Club LV"},
{1249.6998, 2790.4336, 10.8203, "Golf Club LV"},
{1202.2843, 2799.1538, 10.8203, "Golf Club LV"},
{2020.5714, 1015.5516, 10.8203, "Four Dragons Casino"},
{1911.7770, 920.9877, 10.8203, "Four Dragons Casino"},
{1855.9120, 1058.2712, 10.8130, "Four Dragons Casino"},
{1984.4238, 1028.4452, 10.8203, "Four Dragons Casino"},
{-2153.603271, -793.245605, 31.976562, "Foster Valley"},
{-2065.419677, -811.472534, 32.171875, "Foster Valley"},
{-1964.095703, -726.187255, 37.390625, "Foster Valley"},
{-1970.476440, -729.316772, 37.682456, "Foster Valley"},
{-1971.316284, -729.375305, 38.024555, "Foster Valley"},
{-1975.518432, -881.348754, 35.289417, "Foster Valley"},
{-1949.256469, -866.676269, 32.226562, "Foster Valley"},
{-1893.254760, -884.175720, 31.968750, "Foster Valley"},
{-1939.472412, -792.035339, 32.226562, "Foster Valley"},
{-1944.139770, -744.467956, 32.226562, "Foster Valley"},
{-1938.702148, -702.345642, 32.171875, "Foster Valley"},
{-1912.550048, -715.325622, 32.158123, "Foster Valley"},
{-1890.561767, -715.974426, 32.171875, "Foster Valley"},
{-1314.880126, 2523.205566, 93.098388, "Aldea Malvada"},
{-1340.013183, 2566.662841, 92.453392, "Aldea Malvada"},
{-1342.981445, 2577.075195, 77.273002, "Aldea Malvada"},
{-1316.729370, 2595.577880, 73.072959, "Aldea Malvada"},
{-1300.144653, 2546.430664, 87.742187, "Aldea Malvada"},
{-1314.141967, 2528.084716, 87.613708, "Aldea Malvada"},
{-1369.994506, 2530.447753, 77.454376, "Aldea Malvada"},
{-1325.340332, 2516.338378, 87.046875, "Aldea Malvada"},
{-1324.558593, 2532.424560, 87.561912, "Aldea Malvada"},
{-1346.553466, 2565.318115, 80.643333, "Aldea Malvada"},
{-541.176086, -561.201354, 26.798007, "The Fallen Tree"},
{-504.101501, -539.727050, 25.523437, "The Fallen Tree"},
{-503.481170, -527.582458, 25.523437, "The Fallen Tree"},
{-475.996154, -552.346740, 33.121536, "The Fallen Tree"},
{-470.645874, -538.255004, 29.121538, "The Fallen Tree"},
{-466.353302, -468.697967, 25.523437, "The Fallen Tree"},
{-517.881530, -496.789825, 25.523437, "The Fallen Tree"},
{-620.473388, -472.812927, 25.523437, "The Fallen Tree"},
{-644.839599, -445.775238, 27.982749, "The Fallen Tree"},
{-586.403198, -398.734558, 24.491775, "The Fallen Tree"},
{-554.032104, -423.535186, 29.328639, "The Fallen Tree"},
{-488.099975, -449.957580, 42.387664, "The Fallen Tree"},
{-507.062316, -434.387115, 37.013797, "The Fallen Tree"},
{-615.139038, -531.275512, 37.525276, "The Fallen Tree"},
{-624.562072, -509.588043, 33.459438, "The Fallen Tree"},
{-531.809875, -467.091979, 26.224544, "The Fallen Tree"}
};

new Float:MoneyBagPos[3], MoneyBagFound=1, MoneyBagLocation[50], MoneyBagPickup, Timer[2];

//Hours, Minutes, Seconds, Milliseconds
#define MoneyBagDelay(%1,%2,%3,%4) (%1*3600000)+(%2*60000)+(%3*1000)+%4
//20 = 200,00 minimum 30 = 200,00 -> 500,00
#define MoneyBagCash ((random(40)+20)*1000)
//10 mins!
#define MB_DELAY MoneyBagDelay(0, 10, 0, 0)

public OnFilterScriptInit()
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
return 1;
}

forward MoneyBag();
public MoneyBag()
{
new string[175];
if(!MoneyBagFound)
{
format(string, sizeof(string), "{FF9900}SERVER: The Money bag has not been found, it is still hidden in %s", MoneyBagLocation);
SendClientMessageToAll(-1, string);
}
else if(MoneyBagFound)
{
MoneyBagFound = -1;
new randombag = random(sizeof(MBSPAWN));
MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Position]);
format(string, sizeof(string), "{FF9900}SERVER: The Money Bag has been hidden somewhere near/in %s!", MoneyBagLocation);
SendClientMessageToAll(-1, string);
MoneyBagPickup = CreatePickup(1550, 2, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], -1);
}
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerAdmin(playerid))
{
if(!strcmp("/gotomb", cmdtext, true))
{
SetPlayerPos(playerid, MoneyBagPos[0], MoneyBagPos[1] +3, MoneyBagPos[2]);
return SendClientMessage(playerid, -1, "You have been {FF0000}teleported {FFFFFF}to the {33FF66}money bag");
}
if(!strcmp("/startmb", cmdtext, true)) return MoneyBag();
if(!strcmp("/togglemb", cmdtext, true))
{
if(Timer[0] == 0)
{
KillTimer(Timer[1]);
Timer[0] = 1;
SendClientMessage(playerid, -1, "Money bag turned {FF0000} off!");
return 1;
}
if(Timer[0] == 1)
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
Timer[0] = 0;
SendClientMessage(playerid, -1, "Money bag turned {33FF66} on!");
return 1;
}
return 1;
}

}
if(!strcmp("/moneybag", cmdtext, true))
{
new string[150];
if(!MoneyBagFound) format(string, sizeof(string), "{FF9900}SERVER: The Money Bag has been hidden somewhere near/in %s!", MoneyBagLocation);
if(MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag is {FF0000} not running!");
return SendClientMessage(playerid, -1, string);
}
return 0;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == MoneyBagPickup)
{
new string[180], pname[24], money = MoneyBagCash;
GetPlayerName(playerid, pname, 24);
format(string, sizeof(string), "{FF9900}SERVER: %s has found the money bag that had $%d inside, located near/in %s", pname, money, MoneyBagLocation);
MoneyBagFound = 0;
SendClientMessageToAll(-1, string);
DestroyPickup(MoneyBagPickup);
SendClientMessage(playerid, -1, "{FF9900}You have found the Money Bag!");
GivePlayerMoney(playerid, money);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
}
return 1;
}

Reply
#2

This is FS containing only money bag logic. Where's stuff about properties?
Reply
#3

Hey! i've found this around. its might help you. https://sampforum.blast.hk/showthread.php?tid=630012
Reply
#4

@Misiur ...ok here is the property FS by Sandra
Quote:

#include <a_samp>
#include <dini>

#define MAX_PROPERTIES 100
#define MAX_PROPERTIES_PER_PLAYER 3
#define UNBUYABLETIME 120 //If a propertie is bought, someone else have to wait this number of minutes before he/she can buy it.

#define ENABLE_LOGIN_SYSTEM 0
#define ENABLE_MAP_ICON_STREAMER 0
#define UsePropertyTextDraw 1

#define REGISTER_COMMAND "/register"
#define LOGIN_COMMAND "/login"

new PropertiesAmount;
new MP;
enum propinfo
{
PropName[64],
Float:PropX,
Float:PropY,
Float:PropZ,
PropIsBought,
PropUnbuyableTime,
PropOwner[MAX_PLAYER_NAME],
PropValue,
PropEarning,
PickupNr,
}
new PropInfo[MAX_PROPERTIES][propinfo]; //CarInfo
new PlayerProps[MAX_PLAYERS];
new EarningsForPlayer[MAX_PLAYERS];
new Logged[MAX_PLAYERS];

public OnFilterScriptInit()
{
LoadProperties();
MP = GetMaxPlayers();
for(new i; i<MP; i++)
{
if(IsPlayerConnected(i))
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, MAX_PLAYER_NAME);
for(new propid; propid < PropertiesAmount; propid++)
{
if(PropInfo[propid][PropIsBought] == 1)
{
if(strcmp(PropInfo[propid][PropOwner], pName, true)==0)
{
EarningsForPlayer[i] += PropInfo[propid][PropEarning];
PlayerProps[i]++;
}
}
}
}
}
SetTimer("UpdateUnbuyableTime", 60000, 1);
#if ENABLE_MAP_ICON_STREAMER == 1
SetTimer("MapIconStreamer", 500, 1);
#endif
SetTimer("PropertyPayout", 60000, 1);
print("-------------------------------------------------");
print("Property-System by =>Sandra<= Succesfully loaded!");
print("-------------------------------------------------");
return 1;
}
public OnFilterScriptExit()
{
print("Properties Saved!!");
return 1;
}

public OnPlayerConnect(playerid)
{
PlayerProps[playerid] = 0;
Logged[playerid] = 0;
EarningsForPlayer[playerid] = 0;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
for(new propid; propid < PropertiesAmount; propid++)
{
if(PropInfo[propid][PropIsBought] == 1)
{
if(strcmp(PropInfo[propid][PropOwner], pName, true)==0)
{
EarningsForPlayer[playerid] += PropInfo[propid][PropEarning];
PlayerProps[playerid]++;
}
}
}
#if ENABLE_LOGIN_SYSTEM == 1
if(PlayerProps[playerid] > 0)
{
new str[128];
format(str, 128, "You currently own %d properties. Type /myproperties for more info about them.", PlayerProps[playerid]);
SendClientMessage(playerid, 0x99FF66AA, str);
}
#endif
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}
public OnGameModeInit()
{
Create3DTextLabel("Royal Casino\nCost:8000\nEarning:750\n/prophelp",0x008080FF,2088.62,1449.17,10.52,50,0,0) ;
Create3DTextLabel("Four Dragons Casino\nCost:6500\nEarning:900\n/prophelp",0x008080FF,2024.56,1007.65,10.81,50,0,0) ;
Create3DTextLabel("Come A Lot\nCost:6000\nEarning:800\n/prophelp",0x008080FF,2182.12,1115.15,12.35,50,0,0) ;
Create3DTextLabel("Camels Toe\nCost:8000\nEarning:950\n/prophelp",0x008080FF,2208.27,1286.29,10.81,50,0,0) ;
Create3DTextLabel("The High Roller\nCost:6500\nEarning:750\n/prophelp",0x008080FF,1956.68,1342.80,15.35,50,0,0) ;
Create3DTextLabel("Caligula's Casino\nCost:7500\nEarning:800\n/prophelp",0x008080FF,2184.11,1676.77,10.81,50,0,0) ;
Create3DTextLabel("Clowns Pocket\nCost:5000\nEarning:550\n/prophelp",0x008080FF,2220.12,1837.81,10.52,50,0,0) ;
Create3DTextLabel("The Visage\nCost:10000\nEarning:1200\n/prophelp",0x008080FF,2027.27,1914.67,11.93,50,0,0) ;
Create3DTextLabel("Las Venturas Casino\nCost:7500\nEarning:850\n/prophelp",0x008080FF,2165.10,2162.12,10.43,50,0,0) ;
Create3DTextLabel("Well Stacked Pizza\nCost:2500\nEarning:350\n/prophelp",0x008080FF,370.98,-122.94,1001.46,50,0,0);
Create3DTextLabel("ZIP\nCost:2500\nEarning:350\n/prophelp",0x008080FF,161.41,-85.79,1001.78,50,0,0);
Create3DTextLabel("Cluckin Bell\nCost:3500\nEarning:250\n/prophelp",0x008080FF,372.17,-7.71,1001.84,50,0,0);
Create3DTextLabel("Binco\nCost:3500\nEarning:200\n/prophelp",0x008080FF,207.75,-103.05,1005.25,50,0,0);
Create3DTextLabel("Las Venturas Motel\nCost:8000\nEarning:650\n/prophelp",0x008080FF,2084.00,2176.86,10.81,50,0,0) ;
Create3DTextLabel("Tattoo Shop\nCost:3000\nEarning:250\n/prophelp",0x008080FF,-203.13,-42.06,1002.27,50,0,0);
Create3DTextLabel("Barbershop\nCost:3500\nEarning: 200\n/prophelp",0x008080FF,418.95,-78.80,1001.78,50,0,0);
Create3DTextLabel("Las Venturas Sexshop\nCost:4500\nEarning:400\n/prophelp",0x008080FF,2087.2793,2077.0647,11.0579,5 0,0,0);
Create3DTextLabel("Burger Shot\nCost:3500\nEarning:350\n/prophelp",0x008080FF,370.25,-73.25,1001.50,50,0,0);
Create3DTextLabel("Las Venturas Steak House\nCost:4500\nEarning:400\n/prophelp",0x008080FF,1694.01,2206.62,11.06,50,0,0) ;
Create3DTextLabel("Redsands Gasstation\nCost:4000\nEarning:350\n/prophelp",0x008080FF,1600.56,2220.37,11.06,50,0,0) ;
Create3DTextLabel("Las Venturas Airport\nCost:12000\nEarning:1500\n/prophelp",0x008080FF,1675.06,1448.06,10.77,50,0,0) ;
Create3DTextLabel("Los Santos Disco\nCost:3000\nEarning:450\n/prophelp",0x008080FF,1833.43,-1685.06,13.47,50,0,0);
Create3DTextLabel("SkatePark\nCost:4500\nEarning:5 00\n/prophelp",0x008080FF,1881.16,-1399.26,13.27,50,0,0);
Create3DTextLabel("San Andreas Bank\nCost:15000\nEarning:1600\n/prophelp",0x008080FF,1573.68,-1337.43,16.45,50,0,0);
Create3DTextLabel("San Andreas Insurance Company\nCost:9500\nEarning:1150\n/prophelp",0x008080FF,1502.68,-1278.76,14.56,50,0,0);
Create3DTextLabel("Los Santos Hospital\nCost:6500\nEarning:700\n/prophelp",0x008080FF,1177.78,-1323.01,14.06,50,0,0);
Create3DTextLabel("Donutshop\nCost:3500\nEarning:3 50\n/prophelp",0x008080FF,1037.93,-1338.06,13.72,50,0,0);
Create3DTextLabel("The Movie Studio's\nCost:5550\nEarning:650\n/prophelp",0x008080FF,898.90,-1219.81,16.70,50,0,0);
Create3DTextLabel("The Gravejard\nCost:4500\nEarning:350\n/prophelp",0x008080FF,935.82,-1103.17,24.04,50,0,0);
Create3DTextLabel("Comedy Club\nCost:2500\nEarning:150\n/prophelp",0x008080FF,1058.81,-943.88,42.65,50,0,0);
Create3DTextLabel("TennisClub\nCost:3500\nEarning: 250\n/prophelp",0x008080FF,665.21,-1276.93,13.18,50,0,0);
Create3DTextLabel("Vinyl Countdown\nCost:3500\nEarning:250\n/prophelp",0x008080FF,816.03,-1387.68,13.31,50,0,0);
Create3DTextLabel("Prolaps\nCost:2900\nEarning:350 \n/prophelp",0x008080FF,210.52,-129.94,1003.51,50,0,0);
Create3DTextLabel("Mainstreet\nCost:8500\nEarning: 950\n/prophelp",0x008080FF,477.07,-1509.31,20.54,50,0,0);
Create3DTextLabel("The Pier (LS)\nCost:6500\nEarning:500\n/prophelp",0x008080FF,390.35,-2045.67,7.82,50,0,0);
Create3DTextLabel("The Grand Hotel (LS)\nCost:4900\nEarning:370\n/prophelp",0x008080FF,330.39,-1512.43,35.74,50,0,0);
Create3DTextLabel("Victim\nCost:4900\nEarning:370\ n/prophelp",0x008080FF,218.25,-7.98,1001.21,50,0,0);
Create3DTextLabel("Didier Sachs\nCost:7500\nEarning:420\n/prophelp",0x008080FF,204.36,-160.11,1000.52,50,0,0);
Create3DTextLabel("Shopping Mall (LS)\nCost:7500\nEarning:650\n/prophelp",0x008080FF,1129.03,-1457.43,15.77,50,0,0);
Create3DTextLabel("Porn Cinema (LS)\nCost:3500\nEarning:150\n/prophelp",0x008080FF,1123.03,-1130.56,23.79,50,0,0);
Create3DTextLabel("Los Santos Theatre\nCost:4600\nEarning:600\n/prophelp",0x008080FF,1022.59,-1125.06,23.87,50,0,0);
Create3DTextLabel("Maddogs Mansion\nCost:6500\nEarning:1000\n/prophelp",0x008080FF,1254.06,-814.33,84.12,50,0,0);
Create3DTextLabel("The Lighthouse (LS)\nCost:3200\nEarning:160\n/prophelp",0x008080FF,154.13,-1945.42,4.63,50,0,0);
Create3DTextLabel("RS Haul\nCost:3500\nEarning:200\n/prophelp",0x008080FF,-78.05,-1135.93,1.07,50,0,0);
Create3DTextLabel("TruckStop\nCost:3500\nEarning:1 70\n/prophelp",0x008080FF,-24.95,-2509.12,36.63,50,0,0);
Create3DTextLabel("Whetstone GasStation\nCost:4500\nEarning:250\n/prophelp",0x008080FF,-1552.88,-2740.37,48.74,50,0,0);
Create3DTextLabel("Liquorshop Anglepine\nCost:3600\nEarning:250\n/prophelp",0x008080FF,-2105.31,-2432.12,30.62,50,0,0);
Create3DTextLabel("Trailerpark AnglePine\nCost:3500\nEarning:150\n/prophelp",0x008080FF,-2087.30,-2526.87,30.42,50,0,0);
Create3DTextLabel("Police Station Anglepine\nCost:2800\nEarning:250\n/prophelp",0x008080FF,-2162.76,-2387.10,30.62,50,0,0);
Create3DTextLabel("Chill Dogs\nCost:1500\nEarning:170\n/prophelp",0x008080FF,-2198.87,-2387.08,30.62,50,0,0);
Create3DTextLabel("The Junkjard\nCost:4600\nEarning:250\n/prophelp",0x008080FF,-1918.56,-1732.56,21.75,50,0,0);
Create3DTextLabel("San Andreas Watercompany\nCost:9500\nEarning:1110\n/prophelp",0x008080FF,-2062.29,-859.84,32.15,50,0,0);
Create3DTextLabel("San Fiero Stadium\nCost:6500\nEarning:750\n/prophelp",0x008080FF,-2124.36,-445.04,35.52,50,0,0);
Create3DTextLabel("Drivingschool (SF)\nCost:7500\nEarning:650\n/prophelp",0x008080FF,-2022.31,-99.66,35.15,50,0,0);
Create3DTextLabel("San Fiero Airport\nCost:13000\nEarning:1150\n/prophelp",0x008080FF,-1418.64,-292.79,14.14,50,0,0);
Create3DTextLabel("Fightclub 'Cobra' (SF)\nCost:1900\nEarning:250\n/prophelp",0x008080FF,-2268.62,-152.52,35.31,50,0,0);
Create3DTextLabel("Zero's RC\nCost:3500\nEarning:290\n/prophelp",0x008080FF,-2244.12,133.11,35.31,50,0,0);
Create3DTextLabel("Garage Doherty\nCost:6500\nEarning:750\n/prophelp",0x008080FF,-2027.38,148.36,28.79,50,0,0);
Create3DTextLabel("San Fiero Trainstation\nCost:7500\nEarning:650\n/prophelp",0x008080FF,-1983.31,137.99,27.68,50,0,0);
Create3DTextLabel("Wang Cars\nCost:8500\nEarning:1100\n/prophelp",0x008080FF,-1961.56,296.35,35.45,50,0,0);
Create3DTextLabel("Buildingsite (SF)\nCost:3500\nEarning:250\n/prophelp",0x008080FF,-2121.84,208.63,34.86,50,0,0);
Create3DTextLabel("Royal Hotel (SF)\nCost:5500\nEarning:650\n/prophelp",0x008080FF,-2418.62,333.60,35.15,50,0,0);
Create3DTextLabel("The Biffin Bridge Hotel\nCost:7500\nEarning:550\n/prophelp",0x008080FF,-2460.12,135.77,34.83,50,0,0);
Create3DTextLabel("Area 69\nCost:18000\nEarning:2200\n/prophelp",0x008080FF,214.00,1864.00,13.00,50,0,0);
Create3DTextLabel("Emerald Isle\nCost:7500\nEarning:1200\n/prophelp",0x008080FF,2127.4175,2378.3376,10.8203,5 0,0,0);
Create3DTextLabel("Auto Bahn\nCost:5000\nEarning:900\n/prophelp",0x008080FF,2171.7334,1408.8651,11.0625,5 0,0,0);
Create3DTextLabel("Chinatown LV\nCost:8500\nEarning:1100\n/prophelp",0x008080FF,2531.3330,1823.0336,10.8203,5 0,0,0);
Create3DTextLabel("San Andreas Police Dept.\nCost:13000\nEarning:1500\n/prophelp",0x008080FF,2248.4155,2453.1904,10.8203,5 0,0,0);
Create3DTextLabel("Golf Club LV\nCost:14000\nEarning:1600\n/prophelp",0x008080FF,1493.8583,2773.3938,10.8203,5 0,0,0);
Create3DTextLabel("Las Venturas Strip\nCost:16000\nEarning:1450\n/prophelp",0x008080FF,2057.6028,1532.8258,10.6719,5 0,0,0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
if(strcmp(cmd, "/propertyhelp", true)==0 || strcmp(cmd, "/prophelp", true)==0)
{
SendClientMessage(playerid, 0x66CCFFAA, "/buyproperty or /buyprop ==>> To buy a property");
SendClientMessage(playerid, 0x66CCFFAA, "/sellproperty or /sellprop ==>> To sell one of your properties");
SendClientMessage(playerid, 0x66CCFFAA, "/myproperties or /myprops ==>> To see a list of all properties you own");
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0x66CCFFAA, "/sellallproperties [Admin Only] ==>> To sell all properties for all players");
}
SendClientMessage(playerid, 0x6699FFAA, "|================================================ =========|");
return 1;
}
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
if(strcmp(cmd, "/buyproperty", true)==0 || strcmp(cmd, "/buyprop", true)==0)
{
new str[128];
#if ENABLE_LOGIN_SYSTEM == 1
if(Logged[playerid] == 0)
{
format(str, 128, "You have to login before you can buy or sell properties! Use: %s", LOGIN_COMMAND);
SendClientMessage(playerid, 0xFF0000AA, str);
return 1;
}
#endif

new propid = IsPlayerNearProperty(playerid);

if(propid == -1)
{
SendClientMessage(playerid, 0xFF0000AA, "You're not close enough to a property");
return 1;
}
if(PlayerProps[playerid] == MAX_PROPERTIES_PER_PLAYER)
{
format(str, 128, "You already have %d properties, you can't buy more properties!", PlayerProps[playerid]);
SendClientMessage(playerid, 0xFF0000AA, str);
return 1;
}
if(PropInfo[propid][PropIsBought] == 1)
{
new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
if(ownerid == playerid)
{
SendClientMessage(playerid, 0xFF0000AA, "You already own this property!");
return 1;
}
else
{
if(PropInfo[propid][PropUnbuyableTime] > 0)
{
format(str, 128, "This property is already bought by %s.", PropInfo[propid][PropOwner], PropInfo[propid][PropUnbuyableTime]);
SendClientMessage(playerid, 0xFF0000AA, str);
return 1;
}
}
}
if(GetPlayerMoney(playerid) < PropInfo[propid][PropValue])
{
format(str, 128, "You don't have enough money! You need $%d,-", PropInfo[propid][PropValue]);
SendClientMessage(playerid, 0xFF0000AA, str);
return 1;
}
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(PropInfo[propid][PropIsBought] && PropInfo[propid][PropUnbuyableTime] == 0)
{
new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
format(str, 128, "%s has bought your property \"%s\". You recieved 50 percent of it's value ($%d)", pName, PropInfo[propid][PropName], (PropInfo[propid][PropValue]/2));
GivePlayerMoney(ownerid, (PropInfo[propid][PropValue]/2));
SendClientMessage(ownerid, 0xFFFF00AA, str);
PlayerProps[ownerid]--;
}
PropInfo[propid][PropOwner] = pName;
PropInfo[propid][PropIsBought] = 1;
PropInfo[propid][PropUnbuyableTime] = UNBUYABLETIME;
EarningsForPlayer[playerid] += PropInfo[propid][PropEarning];
GivePlayerMoney(playerid, (0-PropInfo[propid][PropValue]));
format(str, 128, "You have bought the property \"%s\" for $%d", PropInfo[propid][PropName], PropInfo[propid][PropValue]);
SendClientMessage(playerid, 0xFFFF00AA, str);
format(str, 128, "%s has bought the property \"%s\".", pName, PropInfo[propid][PropName]);
SendClientMessageToAllEx(playerid, 0xFFFFFFAA, str);
PlayerProps[playerid]++;
return 1;
}
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
if(strcmp(cmd, "/sellproperty", true) == 0 || strcmp(cmd, "/sellprop", true) == 0)
{
new str[128];
#if ENABLE_LOGIN_SYSTEM == 1
if(Logged[playerid] == 0)
{
format(str, 128, "You have to login before you can buy or sell properties! Use: %s", LOGIN_COMMAND);
SendClientMessage(playerid, 0xFF0000AA, str);
return 1;
}
#endif
new propid = IsPlayerNearProperty(playerid);
if(propid == -1)
{
SendClientMessage(playerid, 0xFF0000AA, "You're not close enough to a property");
return 1;
}
if(PropInfo[propid][PropIsBought] == 1)
{
new ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
if(ownerid != playerid)
{
SendClientMessage(playerid, 0xFF0000AA, "You don't own this property!");
return 1;
}
}
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, "Nobody");
PropInfo[propid][PropIsBought] = 0;
PropInfo[propid][PropUnbuyableTime] = 0;
GivePlayerMoney(playerid, (PropInfo[propid][PropValue]/2));
format(str, 128, "You have sold your property \"%s\" for 50 percents of its value: $%d,-", PropInfo[propid][PropName], PropInfo[propid][PropValue]/2);
SendClientMessage(playerid, 0xFFFF00AA, str);
format(str, 128, "%s has sold the property \"%s\".", pName, PropInfo[propid][PropName]);
SendClientMessageToAllEx(playerid, 0xFFFF00AA, str);
PlayerProps[playerid]--;
EarningsForPlayer[playerid] -= PropInfo[propid][PropEarning];
return 1;
}
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
if(strcmp(cmd, "/myproperties", true) == 0 || strcmp(cmd, "/myprops", true) == 0)
{
new str[128], ownerid;
#if ENABLE_LOGIN_SYSTEM == 1
if(Logged[playerid] == 0)
{
format(str, 128, "You have to login before you can buy or sell properties! Use: %s", LOGIN_COMMAND);
SendClientMessage(playerid, 0xFF0000AA, str);
return 1;
}
#endif
if(PlayerProps[playerid] == 0)
{
SendClientMessage(playerid, 0xFF0000AA, "You don't own a property!");
return 1;
}
format(str, 128, "|============ Your %d Properties: =============|", PlayerProps[playerid]);
SendClientMessage(playerid, 0x99FF66AA, str);
for(new propid; propid < PropertiesAmount; propid++)
{
if(PropInfo[propid][PropIsBought] == 1)
{
ownerid = GetPlayerID(PropInfo[propid][PropOwner]);
if(ownerid == playerid)
{
format(str, 128, ">> \"%s\" Value: $%d,- Earnings: $%d,-", PropInfo[propid][PropName], PropInfo[propid][PropValue], PropInfo[propid][PropEarning]);
SendClientMessage(playerid, 0x99FF66AA, str);
}
}
}
SendClientMessage(playerid, 0x99FF66AA, "|============================================ |");
return 1;
}
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
#if ENABLE_LOGIN_SYSTEM == 1
if(strcmp(cmd, REGISTER_COMMAND, true) == 0)
{
new str[128];
if(Logged[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You're already logged in!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(str, 128, "Use: %s 'Your Password'", REGISTER_COMMAND);
SendClientMessage(playerid, 0xFF9966AA, str);
return 1;
}
if(strlen(tmp) < 5) return SendClientMessage(playerid, 0xFF9966AA, "Password too short! At least 5 characters.");
if(strlen(tmp) > 20) return SendClientMessage(playerid, 0xFF9966AA, "Password too long! Max 20 characters.");
new pName[MAX_PLAYER_NAME], pass;
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
pass = dini_Int("PropertySystem/PlayerAccounts.txt", pName);
if(pass == 0)
{
dini_IntSet("PropertySystem/PlayerAccounts.txt", pName, encodepass(tmp));
Logged[playerid] = 1;
format(str, 128, "Your name is now registered in our property-database. Next time use \"%s %s\" to login", LOGIN_COMMAND, tmp);
SendClientMessage(playerid, 0x99FF66AA, str);
}
else
{
format(str, 128, "This name is already registered! Use %s to login!", LOGIN_COMMAND);
SendClientMessage(playerid, 0xFF9966AA, str);
}
return 1;
}
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
if(strcmp(cmd, LOGIN_COMMAND, true) == 0)
{
new str[128];
if(Logged[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You're already logged in!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(str, 128, "Use: %s 'Your Password'", LOGIN_COMMAND);
SendClientMessage(playerid, 0xFF9966AA, str);
return 1;
}
new pName[MAX_PLAYER_NAME], pass;
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
pass = dini_Int("PropertySystem/PlayerAccounts.txt", pName);
if(pass == 0)
{
format(str, 128, "This name is not registered yet! Use %s to register this name!", REGISTER_COMMAND);
SendClientMessage(playerid, 0xFF9966AA, str);
}
else
{
if(pass == encodepass(tmp))
{
Logged[playerid] = 1;
SendClientMessage(playerid, 0x99FF66AA, "You're now logged in! You can now buy and sell properties!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Wrong Password");
}
}
#if ENABLE_LOGIN_SYSTEM == 1
if(PlayerProps[playerid] > 0)
{
format(str, 128, "You currently own %d properties. Type /myproperties for more info about them.", PlayerProps[playerid]);
SendClientMessage(playerid, 0x99FF66AA, str);
}
#endif
return 1;
}
#endif
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
if(strcmp(cmd, "/sellallproperties", true)==0)
{
if(IsPlayerAdmin(playerid))
{
for(new propid; propid<PropertiesAmount; propid++)
{
format(PropInfo[propid][PropOwner], MAX_PLAYER_NAME, "Nobody");
PropInfo[propid][PropIsBought] = 0;
PropInfo[propid][PropUnbuyableTime] = 0;
}
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerProps[i] = 0;
}
}
new str[128], pName[24];
GetPlayerName(playerid, pName, 24);
format(str, 128, "Admin %s has reset all properties!", pName);
SendClientMessageToAll(0xFFCC66AA, str);
}
return 1;
}
//================================================== ================================================== ============================
//================================================== ================================================== ============================
//================================================== ================================================== ============================
return 0;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

stock LoadProperties()
{
if(fexist("PropertySystem/PropertyInfo.txt"))
{
CountProperties();
new Argument[9][70];
new entry[256], BoughtProps;
new File: propfile = fopen("PropertySystem/PropertyInfo.txt", io_read);
if (propfile)
{
for(new id; id<PropertiesAmount; id++)
{
fread(propfile, entry);
split(entry, Argument, ',');
format(PropInfo[id][PropName], 64, "%s", Argument[0]);
PropInfo[id][PropX] = floatstr(Argument[1]);
PropInfo[id][PropY] = floatstr(Argument[2]);
PropInfo[id][PropZ] = floatstr(Argument[3]);
PropInfo[id][PropValue] = strval(Argument[4]);
PropInfo[id][PropEarning] = strval(Argument[5]);
format(PropInfo[id][PropOwner], MAX_PLAYER_NAME, "%s", Argument[6]);
PropInfo[id][PropIsBought] = strval(Argument[7]);
PropInfo[id][PropUnbuyableTime] = strval(Argument[8]);
PropInfo[id][PickupNr] = CreatePickup(1273, 1, PropInfo[id][PropX], PropInfo[id][PropY], PropInfo[id][PropZ]);
if(PropInfo[id][PropIsBought] == 1)
{
BoughtProps++;
}
}
fclose(propfile);
printf("===================================");
printf("|| Created %d Properties ||", PropertiesAmount);
printf("||%d of the properties are bought||", BoughtProps);
printf("===================================");
}
}
}

stock SaveProperties()
{
new entry[256];
new File: propfile = fopen("PropertySystem/PropertyInfo.txt", io_write);
for(new id; id<PropertiesAmount; id++)
{
format(entry, 128, "%s,%.2f,%.2f,%.2f,%d,%d,%s,%d,%d \r\n",PropInfo[id][PropName], PropInfo[id][PropX], PropInfo[id][PropY], PropInfo[id][PropZ], PropInfo[id][PropValue], PropInfo[id][PropEarning], PropInfo[id][PropOwner], PropInfo[id][PropIsBought], PropInfo[id][PropUnbuyableTime]);
fwrite(propfile, entry);
}
printf("Saved %d Properties!", PropertiesAmount);
fclose(propfile);
}

forward split(const strsrc[], strdest[][], delimiter);
public split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc)){
if(strsrc[i]==delimiter || i==strlen(strsrc)){
len = strmid(strdest[aNum], strsrc, li, i, 12;
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}

stock CountProperties()
{
new entry[256];
new File: propfile = fopen("PropertySystem/PropertyInfo.txt", io_read);
while(fread(propfile, entry, 256))
{
PropertiesAmount++;
}
fclose(propfile);
}

forward IsPlayerNearProperty(playerid);
public IsPlayerNearProperty(playerid)
{
new Floatistance;
for(new prop; prop<PropertiesAmount; prop++)
{
Distance = GetDistanceToProperty(playerid, prop);
if(Distance < 1.0)
{
return prop;
}
}
return -1;
}

forward Float:GetDistanceToProperty(playerid, Property);
public Float:GetDistanceToProperty(playerid, Property)
{
new Float1,Float:y1,Float:z1,Float2,Float:y2,Float :z2;
GetPlayerPos(playerid,x1,y1,z1);
x2 = PropInfo[Property][PropX];
y2 = PropInfo[Property][PropY];
z2 = PropInfo[Property][PropZ];
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2 )+floatpower(floatabs(floatsub(y2,y1)),2)+floatpow er(floatabs(floatsub(z2,z1)),2));
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock GetPlayerID(const Name[])
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(i, pName, sizeof(pName));
if(strcmp(Name, pName, true)==0)
{
return i;
}
}
}
return -1;
}

stock SendClientMessageToAllEx(exeption, color, const message[])
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(i != exeption)
{
SendClientMessage(i, color, message);
}
}
}
}

forward UpdateUnbuyableTime();
public UpdateUnbuyableTime()
{
for(new propid; propid<PropertiesAmount; propid++)
{
if(PropInfo[propid][PropIsBought] == 1)
{
if(PropInfo[propid][PropUnbuyableTime] > 0)
{
PropInfo[propid][PropUnbuyableTime]--;
}
}
}
}

stock encodepass(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}

forward MapIconStreamer();
public MapIconStreamer()
{
for(new i; i<MP; i++)
{
if(IsPlayerConnected(i))
{
new Float:SmallestDistance = 99999.9;
new CP, Float:OldDistance;
for(new propid; propid<PropertiesAmount; propid++)
{
OldDistance = GetDistanceToProperty(i, propid);
if(OldDistance < SmallestDistance)
{
SmallestDistance = OldDistance;
CP = propid;
}
}
RemovePlayerMapIcon(i, 31);
if(PropInfo[CP][PropIsBought] == 1)
{
SetPlayerMapIcon(i, 31, PropInfo[CP][PropX], PropInfo[CP][PropY], PropInfo[CP][PropZ], 32, 0);
}
else
{
SetPlayerMapIcon(i, 31, PropInfo[CP][PropX], PropInfo[CP][PropY], PropInfo[CP][PropZ], 31, 0);
}
}
}
}

forward PropertyPayout();
public PropertyPayout()
{
new str[64];
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerProps[i] > 0)
{
GivePlayerMoney(i, EarningsForPlayer[i]);
format(str, 64, "{FFFFFF}You earned $%d from your properties!", EarningsForPlayer[i]);
SendClientMessage(i, 0xFFFF00AA, str);
}
}
}
}

Reply
#5

@XeonMaster
well i'll try it but i'd like to use the same script i started with than a new one.
So please try to find the solution for me
Thank you
Reply
#6

CAN i get a reply guys ?
Reply
#7

Am i gonna be helped ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)