Jihl
Member
Hey there all
Thanks for all the help until now, you are the best community
May I get a little bit of help on this? It is giving me the error that "array_aux" is not defined when the function scr_show_loot_ensured gets called
the code:
Thank you very much!
Thanks for all the help until now, you are the best community
May I get a little bit of help on this? It is giving me the error that "array_aux" is not defined when the function scr_show_loot_ensured gets called
the code:
Code:
// Read Data
var object_type = buffer_read(buffer, buffer_u8)
var my_id = buffer_read(buffer, buffer_u16)
var total_slots = buffer_read(buffer, buffer_u8)
// Create auxiliar array
var array_aux
for (var i = 0; i < total_slots; i+=2)
{
// Add item to the array
array_aux[i] = buffer_read(buffer, buffer_u16)
msg("Got item id: " + string(array_aux[i]))
// Add item quantity to the array
array_aux[i+1] = buffer_read(buffer, buffer_u16)
}
// Find object
var object = scr_object_find(object_type, my_id)
// Use object
if !is_undefined(object)
{
with object
{
// Show the corpse loot
scr_show_loot_ensured(total_slots, array_aux)
}
}
else msg("Object is undefined")