View Single Post
  #6  
Old 10-17-2009, 12:42 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Twinny View Post
PHP Code:
function onCreated()
{
  
this.array = {1,2,3};
  
this.array[0].var = "test";
  
  echo(
this.array[0].var);

Just got that working on Testbed. As Crow said, you won't be able to use 'name' since it's reserved...
I know it is possible without:

NPC Code:
this.array = {1,2,3};



I am trying this for an array of a size that is unknown. So I need to be able to add to the array as needed. Could I just reset the size each time I add a value?

I think I got it now.

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
this.array = new TStaticVar();
  
this.array[0].var = "test";

  
player.chat this.array[0].var;

Reply With Quote