Inventory.wdl
Code:
  
var inv_array[25][2];

var tempfile;
var filehandle;
var aantal;
function File_Read()
{

//var x = 0;
//var y = 0;
//while ( y < 2)
//{
// while(x < 25)
// {
// inv_array[x][y] = 0;
// }
//}



filehandle = file_open_read("items.idf"); // File openen
tempfile =file_var_read(filehandle); //dit moet het ID aangeven
tempfile =file_str_read(filehandle); //dit moet de Naam aangeven
tempfile =file_var_read(filehandle); //dit moet het Gewicht aangeven
tempfile =file_str_read(filehandle); //dit moet het Plaatje aangeven
tempfile =file_str_read(filehandle); //dit moet het Model aangeven
file_close(filehandle);
}


FUNCTION addItem(my.id,Aantal)
{
var i;
i = 0;
while(i<25)
{
if(inv_array[i][0] == my.id)
{
inv_array[i][1] += 1;
return;
}
i+=1;
}
i = 0;
while(i < 25)
{
if(inv_array[i][0] == 0) // empty spot
{
inv_array[i][0] = my.id;
inv_array[i][1] += aantal;
return;
}
i+= 1;
}
}





Hi there my problem is that this script gives me tons of errors while trying to run it.

What isn't correct about it ?
my.id is from objects that you can pickup
aantal is how many you will get from that object.

hope someone understand what im doing here and can help me

(mostly the arrays give errors like inv_array[0])


-The Dragon's Eye is alway's watching you!-