24.10.2009, 16:12
Hi, i'm busy with a new script, but a tiny bug halted me. The wiki says the following:
@ https://sampwiki.blast.hk/wiki/Scripting_Basics >> Arrays
But, when I use the following, which is slightly the same:
I get three errors, all on the same rule, from the same thing, and makes a fourth fatal error:
What is the problem? (Yeah, I know I can use MAX_PLAYERS also in stead of GetMaxPlayers, but this is an example script. The real script really needs away like this.)
I'm using the 0.3a server.
EDIT: Even the exact same as the wiki says doesn't work.
Quote:
new myVariable = 5, myArray[myVariable]; |
But, when I use the following, which is slightly the same:
Код:
public SomePublic() { new bananaAmount = GetMaxPlayers(); //Which gets a number new bananaSlot[bananaAmount]; // Error rule return 1; }
Quote:
1. error 008: must be a constant expression; assumed zero 2. error 009: invalid array size (negative, zero or out of bounds) 3. error 036: empty statement 4. fatal error 107: too many error messages on one line |
I'm using the 0.3a server.
EDIT: Even the exact same as the wiki says doesn't work.