Quote:
Originally Posted by Twinny
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;
}