Guten Tag,
ich habe ein kleines Problem mit einem 3-dimensionalen Array, welches anscheinend nicht richtig gefüllt wird.
Das Ziel sind verschiedene Spawnmöglichkeiten für ein Fahrzeug. Beim Compilieren erscheint diese Meldung, jedoch nur wenn das Array "spawns" verwendet wird:
"error 052: multi-dimensional arrays must be fully initialized"
So wie ich die Meldung verstanden habe, fehlen irgendwo Werte, jedoch kann ich nicht erkennen wo welche fehlen:
enum spawnDaten
{
Float:sX,
Float:sY,
Float:sZ,
Float:sR
}
new spawns[][][spawnDaten] =
{
{
{1038.5244,-1334.5460,13.2680,285.8845},
{980.2036,-1306.3524,13.1038,179.6794},
{984.0997,-1306.4271,13.1041,180.0524},
{791.2729,-1377.4844,13.2630,179.3040},
{791.4148,-1369.8214,13.1901,178.3563},
{956.8908,-1120.6777,23.4483,180.0922},
{919.5719,-1154.9784,23.4629,269.9758},
{1373.4907,-1064.4082,26.2066,352.8188},
{1347.2900,-1062.8961,26.0420,173.3879},
{1265.0863,-1566.6627,13.1946,89.0465},
{1227.7527,-1577.8186,13.1812,269.8445},
{782.1692,-1630.2990,13.1032,89.1950},
{782.3107,-1616.1019,13.1030,270.2963}
},
{
{1643.4578,173.0772,33.4223,346.6324},
{1631.5830,141.1442,35.5017,347.3696},
{1629.6511,132.7597,35.9172,346.7801},
{1627.8810,125.0848,36.2734,346.5476},
{1625.8519,116.6010,36.5617,346.9979},
{2349.6802,245.5507,26.1206,359.1125},
{2338.3662,245.2595,26.1278,179.7534},
{2033.4359,309.9742,26.7446,30.1004},
{1765.0526,826.7740,10.0000,269.9402},
{1757.2183,826.9153,9.7692,268.7795},
{604.2034,342.7098,18.7476,214.3016},
{596.0525,291.7790,18.7055,301.4140}
}
};
{
{
{1038.5244,-1334.5460,13.2680,285.8845},
{980.2036,-1306.3524,13.1038,179.6794},
{984.0997,-1306.4271,13.1041,180.0524},
{791.2729,-1377.4844,13.2630,179.3040},
{791.4148,-1369.8214,13.1901,178.3563},
{956.8908,-1120.6777,23.4483,180.0922},
{919.5719,-1154.9784,23.4629,269.9758},
{1373.4907,-1064.4082,26.2066,352.8188},
{1347.2900,-1062.8961,26.0420,173.3879},
{1265.0863,-1566.6627,13.1946,89.0465},
{1227.7527,-1577.8186,13.1812,269.8445},
{782.1692,-1630.2990,13.1032,89.1950},
{782.3107,-1616.1019,13.1030,270.2963}
},
{
{1643.4578,173.0772,33.4223,346.6324},
{1631.5830,141.1442,35.5017,347.3696},
{1629.6511,132.7597,35.9172,346.7801},
{1627.8810,125.0848,36.2734,346.5476},
{1625.8519,116.6010,36.5617,346.9979},
{2349.6802,245.5507,26.1206,359.1125},
{2338.3662,245.2595,26.1278,179.7534},
{2033.4359,309.9742,26.7446,30.1004},
{1765.0526,826.7740,10.0000,269.9402},
{1757.2183,826.9153,9.7692,268.7795},
{604.2034,342.7098,18.7476,214.3016},
{596.0525,291.7790,18.7055,301.4140}
}
};
main()
{
new msg[200];
format(msg, sizeof(msg), "Hier müsste eigentlich 285.8845 stehen: ... %f ... Aber das geht ja leider nicht!", spawns[0][0][sR]);
print(msg);
}
{
new msg[200];
format(msg, sizeof(msg), "Hier müsste eigentlich 285.8845 stehen: ... %f ... Aber das geht ja leider nicht!", spawns[0][0][sR]);
print(msg);
}
Zum Testen habe ich ein Testarray mit gleichem Aufbau erstellt bei dem alles normal funktioniert:
new testarray[][][] =
{
{
{1,2,3,4},
{5,6,7,8}
},
{
{9,10,11,12},
{13,14,15,16}
}
};
{
{
{1,2,3,4},
{5,6,7,8}
},
{
{9,10,11,12},
{13,14,15,16}
}
};
main()
{
new msg[100];
format(msg, sizeof(msg), "Hier steht eine 12: %i", testarray[1][0][3]);
print(msg);
}
{
new msg[100];
format(msg, sizeof(msg), "Hier steht eine 12: %i", testarray[1][0][3]);
print(msg);
}
Ich komme einfach nicht auf die Lösung weshalb das erste Array nicht funktioniert... Vielleicht kann mir jemand einen Tipp geben