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
.typeSYSTEM
boolean
.scripterboolean
boolean
.levelonlinestartlocal.nw

Attributes
:
boolean.image
boolean.scriptsize0
boolean
.visibility flagsvisible
boolean
.id1014
boolean
.sprite2
boolean
.head
boolean.xprecise0
boolean
.yprecise0

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 = {NULLNULL}; 
Reply With Quote