Array with no value - 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: Array with no value (
/showthread.php?tid=654953)
Array with no value -
binnyl - 10.06.2018
What do i doing wrong on this script?
Код:
SMP.pwn(27978) : warning 219: local variable "plane" shadows a variable at a preceding level
SMP.pwn(27978) : error 009: invalid array size (negative, zero or out of bounds)
SMP.pwn(27978) : error 036: empty statement
SMP.pwn(27980) : error 017: undefined symbol "plane"
SMP.pwn(27980) : warning 215: expression has no effect
SMP.pwn(27980) : error 001: expected token: ";", but found "]"
SMP.pwn(27980) : error 029: invalid expression, assumed zero
SMP.pwn(27980) : fatal error 107: too many error messages on one line
CompSMPation aborted.
Pawn compSMPer 3.10.20150531 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
[Finished in 23.6s with exit code 1]
[cmd: ['pawncc', 'SMP.pwn', '-;+', '-v2', '-d3', '-Z+', '-\\)+']]
[dir: /home/tiago/Documents/sampserver/gamemodes]
[path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games]
Код:
CMD:buyveh(playerid) {
new index = -1;
new plane[]; // 27978
while(++index < sizeof Concesssionaria) {
plane[index] = Concesssionaria[index][modelo]; // 27980
}
ShowModelSelectionMenuEx(playerid, plane, index, "Buy Vehicle", DIALOGID_BUYVEH, 16.0, 0.0, -55.0);
return 1;
}
Re: Array with no value -
xMoBi - 10.06.2018
new plane[sizeof Concesssionaria];
Re: Array with no value -
Sew_Sumi - 10.06.2018
Quote:
Originally Posted by xMoBi
new plane[sizeof Concesssionaria];
|
Ignore this partially...
You've got 2 plane variables, and your second 'usage' of it is wrong and different to what it was defined as. If anything do as above, but change it's name to
Код:
new planetemp[sizeof Concesssionaria];
and address it in this loop as so.
You should be careful using variable names that are close, as they really can trip you up.
Re: Array with no value -
binnyl - 10.06.2018
Thank you guys! I didn't know that i could be done on this way, thanks.
+rep