Quote:
Originally Posted by gaben
i've done it before, but for some reason it just won't work properly
npc vardump:
PHP Code:
Variables dump from npc boolean
boolean.type: SYSTEM
boolean.scripter: boolean
boolean.level: onlinestartlocal.nw
Attributes:
boolean.image:
boolean.script: size: 0
boolean.visibility flags: visible
boolean.id: 1014
boolean.sprite: 2
boolean.head:
boolean.xprecise: 0
boolean.yprecise: 0
this.-Flags
boolean.vote=12
class:
PHP Code:
function onCreated(){
boolean.vote[0] = 1;
sendtonc(boolean.vote[0]); // outputs 12 instead of 1
}
|
To write "vote[0]", vote would need to be initialized as an array first, such as:
PHP Code:
//boolean.vote = new[array size];
boolean.vote = new[2];
or
PHP Code:
boolean.vote = {NULL, NULL};