Basically. I want to make a simple inventory.
array[i].name to be the item. Were i represents the index of the item in inventory. Each appending name after it to represent that detail about the item.
This, however, works. But is there any simpler way to do such a task? I mean I dont see why I must assign a value using add(). =/
PHP Code:
//#CLIENTSIDE
function onCreated()
{
temp.obj = new TStaticVar();
for( i=0; i<10; i++) {
temp.obj.add("");
with( temp.obj[i] ) {
this.var = "test:" SPC i;
}
}
player.chat = temp.obj[1].var;
}
Does:
NPC Code:
temp.obj = new TStaticVar();
Reset the array???
Also, this does not work. Any thoughts?
PHP Code:
//#CLIENTSIDE
function onCreated()
{
temp.obj = new TStaticVar();
temp.obj2 = new TStaticVar();
for( i=0; i<10; i++) {
temp.obj.add("");
with( temp.obj[i] ) {
this.var = "test:" SPC i;
}
}
temp.obj2 = temp.obj[0];
player.chat = temp.obj2.var;
}
Just wondering about the above. Why would that not work?