SA-MP Forums Archive
problem with variables - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problem with variables (/showthread.php?tid=154481)



problem with variables - D1ma - 14.06.2010

why this is working:
Код:
new cars[4][0] = {
{432}, {425}, {520}, {447}
};
and this not working:
Код:
new HouseCost[5][0] = {
{35000000} , {20000000} , {15000000} , {15000000} , {15000000} , {50000000}
};
for the numbers that giving me the error:
error 018: initialization data exceeds declared size

and for the }; that giving me the error:
error 010: invalid function or declaration

what is the problem?
thanks.


Re: problem with variables - cessil - 14.06.2010

you have 6 house costs not 5 like you have defined it having


Re: problem with variables - Joe Staff - 14.06.2010

And you don't need to add a 0 sized cell, just do this:

pawn Код:
new HouseCosts[6]={
  35000000,
  20000000,
  15000000,
  15000000,
  15000000,
  50000000
};