Jump to content

Help


~Gangsta~

Recommended Posts

That's true , so you start learning small things to be understand as you're a beginner , but i won't mind giving you an example just a few minutes.

edit:

here you go

local topMoney = {} 
  
function top(player) 
    for i,v in ipairs(getElementsByType("player")) do -- get all players 
        if(getPlayerMoney(v)>1000)then -- and the player who have more than 1 thousand 
            topMoney[ getPlayerName(v) ] = " money: " .. getPlayerMoney(v) -- insert him into the table with his money 
        end 
    end 
    for i,v in pairs(topMoney) do 
        table.sort(topMoney) -- sorting  
        outputChatBox("Top players who are having more than 1 thousand is " .. i .. " Money: " .. v,player) -- output to the player who typed this command the players who are having more than 1 thousand 
    end 
end 
addCommandHandler("topMoney",top) 

I'm not sure if it's gonna work , but it should work.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...