-
Sziasztok.
Van egy olyan problémám hogy, probálok csinálni olyan dm mapot, hogy több spawn legyen. Nos ezzel akadt egy kis problémám.
initialization data exceeds declared size
- ezt az errort kaptam.
Itt a kód:
new PlayerDM[6][][MapInfo] =
{
{ // X Y Z A Name
{1306.9261,2195.0313,11.0234,212.9963,\"Baseball\"}, // home
{1391.2493,2111.0488,11.0156,321.7007,\"Baseball\"}, // away
{1367.4415,2196.2263,14.2495,177.9026,\"Baseball\"} // spec
},
{ // X Y Z A Name
{-1345.5286,-37.3892,14.1484,225.0086,\"Letisko\"}, // home
{-1208.0022,-175.5290,14.1484,42.0436,\"Letisko\"}, // away
{-1216.2174,-66.8861,27.3633,131.1527,\"Letisko\"} // spec
},
{ // X Y Z A Name
{-2056.5076,-124.6376,35.3165,178.2982,\"Autoskola\"}, // home
{-2059.4060,-270.5007,35.3274,358.9248,\"Autoskola\"}, // away
{-2030.4725,-109.1537,38.9219,167.1116,\"Autoskola\"} // spec
},
{ // X Y Z A Name
{-1418.5332,-210.2689,14.1484,221.8400,\"Letisko 2\"}, // home
{-1315.3934,-298.6832,14.1484,38.5849,\"Letisko 2\"}, // away
{-1382.1400,-266.8230,28.7545,317.7209,\"Letisko 2\"} // spec
},
{ // X Y Z A Name
{1584.6635,743.0764,10.8203,182.6550,\"Hangary\"}, // home
{1744.0894,703.4059,10.8203,4.5351,\"Hangary\"}, // away
{1664.3020,694.7566,19.9430,359.0399,\"Hangary\"} // spec
},
{ // X Y Z A Name
{2158.4126,-2317.2808,15.8181,316.0486,\"Stock\"}, // home
{2142.4778,-2317.7878,13.5314,309.3511,\"Stock\"}, // home
{2253.5313,-2230.9248,13.5469,133.3571,\"Stock\"}, // away
{2205.3960,-2191.8752,13.5547,223.3296,\"Stock\"}, // away
{2189.3252,-2317.8201,29.5435,43.8929,\"Stock\"} // spec
} <-- Erre jelzi a hibát
};
[/quote]
Dupla hozzászólás automatikusan összefûzve. ( [time]2016. október 23. 12:58:38[/time] )
-
new PlayerDM[6][][32] =
{
{ // X Y Z A Name
{1306.9261,2195.0313,11.0234,212.9963,\"Baseball\"}, // home
{1391.2493,2111.0488,11.0156,321.7007,\"Baseball\"}, // away
{1367.4415,2196.2263,14.2495,177.9026,\"Baseball\"} // spec
},
{ // X Y Z A Name
{-1345.5286,-37.3892,14.1484,225.0086,\"Letisko\"}, // home
{-1208.0022,-175.5290,14.1484,42.0436,\"Letisko\"}, // away
{-1216.2174,-66.8861,27.3633,131.1527,\"Letisko\"} // spec
},
{ // X Y Z A Name
{-2056.5076,-124.6376,35.3165,178.2982,\"Autoskola\"}, // home
{-2059.4060,-270.5007,35.3274,358.9248,\"Autoskola\"}, // away
{-2030.4725,-109.1537,38.9219,167.1116,\"Autoskola\"} // spec
},
{ // X Y Z A Name
{-1418.5332,-210.2689,14.1484,221.8400,\"Letisko 2\"}, // home
{-1315.3934,-298.6832,14.1484,38.5849,\"Letisko 2\"}, // away
{-1382.1400,-266.8230,28.7545,317.7209,\"Letisko 2\"} // spec
},
{ // X Y Z A Name
{1584.6635,743.0764,10.8203,182.6550,\"Hangary\"}, // home
{1744.0894,703.4059,10.8203,4.5351,\"Hangary\"}, // away
{1664.3020,694.7566,19.9430,359.0399,\"Hangary\"} // spec
},
{ // X Y Z A Name
{2158.4126,-2317.2808,15.8181,316.0486,\"Stock\"}, // home
{2142.4778,-2317.7878,13.5314,309.3511,\"Stock\"}, // home
{2253.5313,-2230.9248,13.5469,133.3571,\"Stock\"}, // away
{2205.3960,-2191.8752,13.5547,223.3296,\"Stock\"}, // away
{2189.3252,-2317.8201,29.5435,43.8929,\"Stock\"} // spec
}
};
Próbáld ki így [nálam lefutott így.
-
Nagyon sok warningot kaptam és egy ilyen errort:
error 018: initialization data exceeds declared size
-
new PlayerDM[6][][32] =
{
{ // X Y Z A Name
{1306.9261,2195.0313,11.0234,212.9963,\"Baseball\"}, // home
{1391.2493,2111.0488,11.0156,321.7007,\"Baseball\"}, // away
{1367.4415,2196.2263,14.2495,177.9026,\"Baseball\"} // spec
},
{ // X Y Z A Name
{-1345.5286,-37.3892,14.1484,225.0086,\"Letisko\"}, // home
{-1208.0022,-175.5290,14.1484,42.0436,\"Letisko\"}, // away
{-1216.2174,-66.8861,27.3633,131.1527,\"Letisko\"} // spec
},
{ // X Y Z A Name
{-2056.5076,-124.6376,35.3165,178.2982,\"Autoskola\"}, // home
{-2059.4060,-270.5007,35.3274,358.9248,\"Autoskola\"}, // away
{-2030.4725,-109.1537,38.9219,167.1116,\"Autoskola\"} // spec
},
{ // X Y Z A Name
{-1418.5332,-210.2689,14.1484,221.8400,\"Letisko 2\"}, // home
{-1315.3934,-298.6832,14.1484,38.5849,\"Letisko 2\"}, // away
{-1382.1400,-266.8230,28.7545,317.7209,\"Letisko 2\"} // spec
},
{ // X Y Z A Name
{1584.6635,743.0764,10.8203,182.6550,\"Hangary\"}, // home
{1744.0894,703.4059,10.8203,4.5351,\"Hangary\"}, // away
{1664.3020,694.7566,19.9430,359.0399,\"Hangary\"} // spec
},
{ // X Y Z A Name
{2158.4126,-2317.2808,15.8181,316.0486,\"Stock\"}, // home
{2142.4778,-2317.7878,13.5314,309.3511,\"Stock\"}, // home
{2253.5313,-2230.9248,13.5469,133.3571,\"Stock\"}, // away
{2205.3960,-2191.8752,13.5547,223.3296,\"Stock\"}, // away
{2189.3252,-2317.8201,29.5435,43.8929,\"Stock\"} // spec
}
};
Próbáld ki így [nálam lefutott így.
Az a gond, hogy az első 5 elem mérete 3,a 6. elemé pedig 5.. :) ahova 32-t írtál ott csak a belso tombok szerkezete volt megadva. Ha nincs megadva \"major dimension\" akkor a compiler az inicializáció alapján próbálja meg kiszámítani, ami nem fog működni különböző méretekkel. Mivel alapul veszi a 3-at,amit az 5 meghalad. Ha előre rakod a nagyobb elemet, akkor pedig az lesz a gond, h nincs megfeleloen inicializálva, mert a 3 elem helyére is 5 elemet fog várni. Lehet amúgy ezzel játszani, \"jagged array\" néven keress rá :) de az amx assembler már haladó téma szerintem..
a kérdezőnek azt tudom javasolni, hogy ne így próbáld tárolni, hanem külön tömbökben, amúgy se egy szép megoldás ebben a formajaban :)
-
Szia ha a fenti nem jó, így próbáld meg. :wave:
new PlayerDM[20][5] =
{
{1306.9261,2195.0313,11.0234,212.9963,\"Baseball\"}, // home
{1391.2493,2111.0488,11.0156,321.7007,\"Baseball\"}, // away
{1367.4415,2196.2263,14.2495,177.9026,\"Baseball\"}, // spec
{-1345.5286,-37.3892,14.1484,225.0086,\"Letisko\"}, // home
{-1208.0022,-175.5290,14.1484,42.0436,\"Letisko\"}, // away
{-1216.2174,-66.8861,27.3633,131.1527,\"Letisko\"}, // spec
{-2056.5076,-124.6376,35.3165,178.2982,\"Autoskola\"}, // home
{-2059.4060,-270.5007,35.3274,358.9248,\"Autoskola\"}, // away
{-2030.4725,-109.1537,38.9219,167.1116,\"Autoskola\"}, // spec
{-1418.5332,-210.2689,14.1484,221.8400,\"Letisko 2\"}, // home
{-1315.3934,-298.6832,14.1484,38.5849,\"Letisko 2\"}, // away
{-1382.1400,-266.8230,28.7545,317.7209,\"Letisko 2\"}, // spec
{1584.6635,743.0764,10.8203,182.6550,\"Hangary\"}, // home
{1744.0894,703.4059,10.8203,4.5351,\"Hangary\"}, // away
{1664.3020,694.7566,19.9430,359.0399,\"Hangary\"}, // spec
{2158.4126,-2317.2808,15.8181,316.0486,\"Stock\"}, // home
{2142.4778,-2317.7878,13.5314,309.3511,\"Stock\"}, // home
{2253.5313,-2230.9248,13.5469,133.3571,\"Stock\"}, // away
{2205.3960,-2191.8752,13.5547,223.3296,\"Stock\"}, // away
{2189.3252,-2317.8201,29.5435,43.8929,\"Stock\"} // spec
};