SA-MP Forums Archive
error 018: initialization data exceeds declared size - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 018: initialization data exceeds declared size (/showthread.php?tid=294621)



error 018: initialization data exceeds declared size - [IL]HeHu - 02.11.2011

PHP код:
C:\Users\Mark\Desktop\GRP(0.3d).pwn(849) : error 018initialization data exceeds declared size 
This is the error I get.

PHP код:
new RentVehicles[][3] = {
    {
405,500,"~y~~h~Good handling and acceptable speed, good for people who like a safe road"},
    {
421,560,"~y~~h~Quite good hnadling, and the speed is nice too - a bit better than Sentinel"},
     {
426,800,"~y~~h~Great handling, great speed, shows a wealthy person straight away"},
     {
445,600,"~y~~h~Nice handling, nice speed, good for old-school drivers"},
     {
475,640,"~y~~h~Acceptable handling, great speed, good for taking your girl or boy out on a date"},
     {
500,620,"~y~~h~Nice handling, nice speed, great if you want to go out with friends"},
     {
527,720,"~y~~h~Great handling, nice speed, good for the day-to-day life"}
}; 
On these lines


Re: error 018: initialization data exceeds declared size - Wesley221 - 02.11.2011

pawn Код:
new RentVehicles[7][3] = {
    {405,500,"~y~~h~Good handling and acceptable speed, good for people who like a safe road"}, // line 0
    {421,560,"~y~~h~Quite good hnadling, and the speed is nice too - a bit better than Sentinel"}, // line 1
     {426,800,"~y~~h~Great handling, great speed, shows a wealthy person straight away"},
     {445,600,"~y~~h~Nice handling, nice speed, good for old-school drivers"},
     {475,640,"~y~~h~Acceptable handling, great speed, good for taking your girl or boy out on a date"},
     {500,620,"~y~~h~Nice handling, nice speed, great if you want to go out with friends"},
     {527,720,"~y~~h~Great handling, nice speed, good for the day-to-day life"} // line 7
};
Where the '7' is in now, those are the lines that are inside the 'new', check the comments for more info


Re: error 018: initialization data exceeds declared size - [IL]HeHu - 02.11.2011

^ This will not help, I just removed 7 because I wanted to add more.
When we have this '[]' it means that the amount is not limited and is undefined.
Thanks for trying though.


Re: error 018: initialization data exceeds declared size - [IL]HeHu - 02.11.2011

Friend helped me out, nvm