Jump to content

Help


~Gangsta~

Recommended Posts

Posted

Use:

getElementsByType 
getPlayerMoney 
table.sort 
outputChatBox 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

If you just started, then you may want to start with something simpler.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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.

F4MZM4.gif

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...