You dont need any args for it.
local t = { "b", "c", "a", "d" }
print( unpack(t) ) -->> b c a d
table.sort( t )
print( unpack(t) ) -->> a b c d
EDIT:
But then again, you cant just sort getElementsByType("player") afaik as that returns elements.
If you want it to sort by the player names, you could do:
local players = getElementsByType( "player" ) -- Get all the players.
local playerNames = {} -- Create a table to store the player names.
for i=1,#players do -- Loop through all players.
local playerName = getPlayerName( players[i] ) -- Get the players name.
table.insert( playerNames, playerName ) -- Store the players name in the new table.
end
table.sort( playerNames ) -- Sort the new table.
print( unpack( playerNames ) ) -->> aPlayer bPlayer cPlayer dPlayer