Wrote this yesterday, All of these vectors can be found in the gta3.zon file. One of the districts returned the wrong Island. So I changed it.
Version 2:
// Island
/* X1, Y1, Z1, X2, Y2, Z2, Island */ //format
local Zones = [
[617.442, -958.347, 6.26083, 1065.44, -908.347, 206.261, 1],
[751.68, -1178.22, -13.8723, 1065.68, -958.725, 136.128, 1],
[944.208, -1149.81, -9.72576, 1016.14, -1076.01, 40.2742, 1],
[1065.88, -1251.55, -13.5049, 1501.88, -1069.93, 136.495, 1],
[1363.68, -1069.65, -18.8643, 1815.68, -613.646, 131.136, 1],
[1065.88, -1069.85, 1.49868, 1363.38, -742.054, 151.499, 1],
[745.421, -908.289, -21.203, 1065.42, -463.69, 129.593, 1],
[745.378, -463.616, -22.6676, 1065.38, -282.616, 147.332, 1],
[745.421, -282.4, -13.4117, 1065.42, -78.7699, 136.588, 1],
[1065.9, -512.324, -14.296, 1388.9, -78.324, 135.704, 1],
[745.979, -78.1778, -48.5832, 1388.98, 322.676, 101.417, 1],
[1389.37, -613.467, -29.883, 1797.6, 199.628, 120.117, 1],
[1066.1, -741.806, -34.2068, 1363.6, -512.806, 115.793, 1],
[1135.8, -695.021, 6.9661, 1182.36, -631.021, 56.9661, 1],
[1136.09, -609.976, 6.287, 1182.09, -521.167, 56.287, 1],
[617.151, -1329.72, -117.535, 1902.66, 434.115, 482.465, 1],
[1037.53, -907.274, 0.0, 1065.16, -637.689, 30.0069, 1],
[966.079, -637.366, 0.0, 1064.83, -609.557, 30.0789, 1],
[965.795, -608.99, 0.0, 995.306, -470.23, 30.9302, 1],
[995.59, -511.092, 0.0, 1065.11, -470.23, 30.0789, 1],
[1035.88, -463.56, 0.0, 1064.83, -282.86, 30.3627, 1],
[1036.15, -281.96, 0.0, 1064.85, -179.224, 30.6465, 1],
[-265.444, 161.113, -41.7094, -121.287, 367.043, 358.291, 1],
[1363.77, -613.339, -4.43849, 1389.17, -512.539, 70.4322, 1],
[444.768, -958.298, 30.7441, 614.878, -908.298, 180.744, 2],
[239.878, -411.617, 7.62939e-005, 614.322, -61.6167, 163.819, 2],
[-225.764, -412.604, -9.53674e-005, 116.236, 160.496, 120.271, 2],
[199.766, -1672.42, -61.7588, 577.766, -1059.93, 432.688, 2],
[-224.438, -1672.05, -61.3183, 199.562, -1004.45, 432.352, 2],
[200.107, -1059.19, -0.000144958, 615.107, -412.193, 198.864, 2],
[-121.567, -1003.07, -46.7463, 199.271, -413.068, 224.163, 2],
[117.268, -411.622, 0.000190735, 239.268, -61.6218, 166.36, 2],
[117.236, -61.1105, -17.071, 615.236, 268.889, 83.754, 2],
[-265.479, -1719.97, -114.769, 615.52, 367.265, 485.231, 2],
[-265.434, 79.0922, -45.8201, -226.334, 161.064, 354.18, 2],
[-1632.97, -1344.71, -45.9404, -468.629, -268.443, 254.696, 3],
[-811.835, -268.074, -45.8745, -371.041, 92.7263, 254.241, 3],
[-867.229, 93.3882, -50.1134, -266.914, 650.058, 250.426, 3],
[-1407.57, -267.966, -49.6792, -812.306, 92.7559, 250.437, 3],
[-1394.5, 93.4441, -46.7412, -867.52, 704.544, 253.344, 3],
[-1644.64, -1351.38, -117.0, -266.895, 1206.35, 483.0, 3],
[-1238.59, 306.841, -0.48605, -910.445, 504.646, 39.514, 3]
];
local Current_Island = 0;
local Current_District = "Liberty City"
NewTimer("AreaChecker", 1000, 0);
function AreaChecker() {
local Player_Vector = FindLocalPlayer().Pos;
for (local idx=0;idx<42;idx++) {
if ( ( Player_Vector.x >= Zones[idx][0] ) && ( Player_Vector.x <= Zones[idx][3] ) && ( Player_Vector.y >= Zones[idx][1] ) && ( Player_Vector.y <= Zones[idx][4] ) ) {
if (Current_Island != Zones[idx][6]) {
Current_Island = Zones[idx][6];
BigMessage("" + Island(Zones[idx][6]), 8000, 1);
}
if (Current_District != GetDistrictName(Player_Vector.x, Player_Vector.y)) {
Current_District = GetDistrictName(Player_Vector.x, Player_Vector.y);
BigMessage("" + GetDistrictName(Player_Vector.x, Player_Vector.y), 1000, 6);
}
}
}
}
// Island
// Added for testing
function onClientCommand ( Command, Input ) {
if (Command == "island") Message(Current_Island.tostring())
if (Command == "district") Message(Current_District.tostring())
return 1;
}
I can add District ID's, as well my own District name return versus using GetDistrictName, but I feel like it's wasted time. You should find good uses of this script as well using it to manipulate player positions.