Why do Addons return as individual arrays? Where as query all records returns a normal array?

Options

players_in is an addon where are all_players is a query all records.

You can see by the additional [] in players_in that it is storing all the records from the addon in their own array.

Why is this and how do I fix it?

I need players_in to output the same as all_players

Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    hey @jimmy - it looks like you want your Addon to be a return type of single instead of list. It looks like you are doing an Addon from a list (array) of table references. Since each item in the list represents a single player, your return type should reflect that to be single in this case. Try it out and let me know if that works!

  • jimmy
    jimmy Member
    Options

    Hey Micheal, thanks so much for this!! Real life saver.

    Out of interest, in what situation would I use the list addon then? It seems quite a confusing ui naming it a list as I had a list of players so it seemed like the right option.