18.04.2017, 10:36
so I have this code
when I am in sf and want to reset car it always spawn at lv why?
tvar2 is the vehicle model
plz help thanks
PHP код:
for (new d = 0; d < sizeof(pdCoords); d++)
{
if (PointToPoint2D(x, y, pdCoords[d][0], pdCoords[d][1]) <= PointToPoint2D(x, y, pdCoords[tvar3][0], pdCoords[tvar3][1])) {
tvar4 = -1;
for (new b = 0; b < sizeof(pdCarCoords); b++) {
if (pdCarCoords[b][4] == d+1 && holdsv[b] == 0) {
tvar4 = b;
break;
}
}
if (tvar4 != -1) {
moneys1 = tvar4;
}
tvar3 = d;
}
}
PHP код:
new Float:pdCarCoords[42][5] =
{
{1549.322, -1607.101, 13.363, 180.0, LS_CAR},
{1553.322, -1607.101, 13.363, 180.0, LS_CAR},
{1557.322, -1607.101, 13.363, 180.0, LS_CAR},
{1561.322, -1607.101, 13.363, 180.0, LS_CAR},
{1565.322, -1607.101, 13.363, 180.0, LS_CAR},
{1569.322, -1607.101, 13.363, 180.0, LS_CAR},
{1573.322, -1607.101, 13.363, 180.0, LS_CAR},
{1577.322, -1607.101, 13.363, 180.0, LS_CAR},
{1581.322, -1607.101, 13.363, 180.0, LS_CAR},
{1585.322, -1607.101, 13.363, 180.0, LS_CAR},
{641.301, -610.118, 16.323, 0.0, RC_CAR},
{638.101, -610.118, 16.323, 0.0, RC_CAR},
{634.901, -610.118, 16.323, 0.0, RC_CAR},
{631.701, -610.118, 16.323, 0.0, RC_CAR},
{-2177.209, -2368.741, 30.507, 51.5, FC_CAR},
{-2172.623, -2362.960, 30.607, 51.5, FC_CAR},
{-1575.799, 651.273, 7.170, 0.0, SF_CAR},
{-1581.799, 651.273, 7.170, 0.0, SF_CAR},
{-1587.799, 651.273, 7.170, 0.0, SF_CAR},
{-1593.799, 651.273, 7.170, 0.0, SF_CAR},
{-1599.799, 651.273, 7.170, 0.0, SF_CAR},
{-1605.799, 651.273, 7.170, 0.0, SF_CAR},
{-1611.799, 651.273, 7.170, 0.0, SF_CAR},
{-1582.358, 673.775, 7.171, 180.0, SF_CAR},
{-1588.358, 673.775, 7.171, 180.0, SF_CAR},
{-1594.358, 673.775, 7.171, 180.0, SF_CAR},
{-1400.275, 2659.710, 55.669, 90.0, BC_CAR},
{-1400.275, 2656.610, 55.669, 90.0, BC_CAR},
{-1400.275, 2653.510, 55.669, 90.0, BC_CAR},
{-227.024, 991.365, 19.507, 270.0, LV_CAR},
{-227.024, 995.565, 19.507, 270.0, LV_CAR},
{-227.024, 999.765, 19.507, 270.0, LV_CAR},
{-210.690, 999.486, 19.639, 90.0, LV_CAR},
{-210.690, 995.986, 19.639, 90.0, LV_CAR},
{2256.107, 2477.494, 10.602, 0.0, T__CAR},
{2269.168, 2477.488, 10.602, 0.0, T__CAR},
{2282.179, 2477.487, 10.602, 0.0, T__CAR},
{2282.161, 2459.625, 10.602, 180.0, T__CAR},
{2273.485, 2460.030, 10.602, 0.0, T__CAR},
{256.106, 2460.021, 10.602, 0.0, T__CAR},
{2256.085, 2442.683, 10.602, 180.0, T__CAR},
{2273.512, 2442.702, 10.602, 180.0, T__CAR}
};
new Float:pdCoords[7][4] =
{
{1543.836, -1627.441, 13.165, 90.0},
{636.889, -574.683, 16.040, 180.076},
{-2188.499, -2352.594, 30.329, 141.5},
{-1578.228, 662.371, 6.970, 270.0},
{-1413.360, 2641.157, 55.469, 90.0},
{-218.827, 1005.342, 19.497, 0.0},
{2241.085, 2453.84, 10.602, 90.0}
};
new holdsv[sizeof(pdCarCoords)];
new pdNames[][] =
{
{"Los Santos Police Department"},
{"Dillimore Police Department, Red County"},
{"Angel Pine Police Department, Whetstone"},
{"San Fierro Police Department"},
{"El Quebrados Police Department, Tierra Robada"},
{"Fort Carson Police Department, Bone County"},
{"Las Venturas Police Department"}
};
PHP код:
CreateVehicle(tvar2, pdCarCoords[moneys1][0], pdCarCoords[moneys1][1], pdCarCoords[moneys1][2], pdCarCoords[moneys1][3], vehcol[pvehicle[playerid][0]][0], vehcol[pvehicle[playerid][0]][1], -1);
plz help thanks