Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

error 052: multi-dimensional arrays must be fully initialized

$
0
0
PHP Code:

new TrailerDestination[][][Trailer] =
{
    {
        {
"Gas Station"1941.9574, -1790.263713.3828},
        {
"Gas Station"980.5435, -921.293041.2895}
    },
    {
        {
"Ammu Nation"1363.7482, -1287.414813.5469}
    }, 
// ====================================== error line
    
{
        {
"Well Stacked Pizza"2094.8977, -1800.015413.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(playeridparams[])
{
    new 
Float:xFloat:yFloat:ztrailertype 0string[128] = "Destination\nDistance\n";
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_PLAYER"ERROR: You are not in any vehicle!");
    switch(
GetVehicleTrailer(GetPlayerVehicleID(playerid)))
    {
        case 
584trailertype 0;
        default: 
SendClientMessage(playeridCOLOR_PLAYER"ERROR: You do not have any trailers on your truck!");
     }
     
GetPlayerPos(playeridxyz);
    for(new 
07i++)
    {
        
format(stringsizeof(string), "%s%s\n%f"stringTrailerDestination[trailertype][i][Name], GetDistance(xyzTrailerDestination[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
Help.

EDIT: GetDistance works.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>