View Single Post
  #2  
Old 09-23-2011, 11:51 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by gaben View Post
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}; 
Reply With Quote