17.12.2017, 12:16
PHP Code:
new TrailerDestination[][][Trailer] =
{
{
{"Gas Station", 1941.9574, -1790.2637, 13.3828},
{"Gas Station", 980.5435, -921.2930, 41.2895}
},
{
{"Ammu Nation", 1363.7482, -1287.4148, 13.5469}
}, // ====================================== error line
{
{"Well Stacked Pizza", 2094.8977, -1800.0154, 13.3426},
{"Cluckin' Bell", 2370.5210,-1910.6147,13.1099},
{"Cluckin' Bell", 2408.2141,-1482.2157,23.5552},
{"Cluckin' Bell", 922.3662,-1358.4125,13.0151},
{"Joe's Sticky Ring", 1015.9811,-1345.2292,13.1014},
{"Burger Shot", 788.3559,-1635.6775,13.1099},
{"Burger Shot", 788.3559,-1635.6775,13.1099}
},
{
{"Construction Materials", 1857.0723,-1321.2823,13.1993}
}
};
CMD:work(playerid, params[])
{
new Float:x, Float:y, Float:z, trailertype = 0, string[128] = "Destination\nDistance\n";
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_PLAYER, "ERROR: You are not in any vehicle!");
switch(GetVehicleTrailer(GetPlayerVehicleID(playerid)))
{
case 584: trailertype = 0;
default: SendClientMessage(playerid, COLOR_PLAYER, "ERROR: You do not have any trailers on your truck!");
}
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i < 7; i++)
{
format(string, sizeof(string), "%s%s\n%f", string, TrailerDestination[trailertype][i][Name], GetDistance(x, y, z, TrailerDestination[trailertype][i][DestX], TrailerDestination[trailertype][i][DestY], TrailerDestination[trailertype][i][DestZ]));
}
return 1;
}
Code:
C:\Users\metro\Documents\SA-MP\gamemodes\ls2.pwn(38) : error 052: multi-dimensional arrays must be fully initialized
EDIT: GetDistance works.