Chaz-CR Posted July 9, 2014 Share Posted July 9, 2014 Hello, i was making a gridlist where i can see the player nicknames but when i trigger the function i receive the accountName and i dont know how to change it to the PlayerName! There are the codes: function getPlayerKillsInOrder() theTable = {} for i, acc in ipairs(getAccounts()) do local name = getAccountName(acc) local kills = getAccountData(acc, "Kills") or 0 table.insert(theTable, {kills, name}) end ------not necessary the Trigger: addEvent("refreshList", true) addEventHandler("refreshList", root, function() triggerClientEvent(source, "onRequestRefresh", source, getPlayerKillsInOrder()) theTable = nil end) Link to comment
Arnold-1 Posted July 9, 2014 Share Posted July 9, 2014 function getPlayerKillsInOrder() theTable = {} for i, acc in ipairs(getAccounts()) do local name = getAccountName(acc) local player = getAccountPlayer(acc) if player then playerName = getPlayerName(player) end local kills = getAccountData(acc, "Kills") or 0 table.insert(theTable, {kills, playerName}) end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now