Shortening jQuery array
It appears that you're just trying to create a list of players from the id values on a list of &lt;li&gt; tags and also build a comma separated list of those ids.  If that's the case, you can do the entire code block like this:

var players = $("#jailplayer &gt; li").map(function(index, elem) {
    return this.id;
}).toArray();
var sender = players.join(",");


Note: this doesn't populate variables player1, player2, etc...  Instead, it puts the players into an array where they are likely easier to deal with later.



Also, it is unclear what you are trying to do with this:

var ize = [sender];


If you explain the purpose of that, we could offer help on whether that's the right way to to it.  Storing an array of a single value that's a comma separated string list of values seems a bit odd which is why I ask.



Key concepts here:

$("#jailplayer &gt; li") - get all the desired &lt;li&gt; tags into a jQuery collection so we can iterate over them.

.map() - iterates over a jQuery collection building a new jQuery object containing the values that the callback returns.  Note, the callback will be passed this as each successive element in the original jQuery collection and the id value can be referenced simply as this.id.

.toArray() - get the array out of the jQuery object that was returned so you have just an array, not a jQuery object any more.

.join(",") - take all the elements of the array and join them into a string with the passed in separator between them.