Jump to content

Take player money


MatXpl

Recommended Posts

function ta(thePlayer, command, who, amount) 
local ne = getPlayerFromName ( who ) 
local e = getPlayerName ( thePlayer ) 
        if isObjectInACLGroup ( "user." .. e, aclGetGroup ( "Admin" ) ) then 
takePlayerMoney (ne, math.abs(tonumber(amount))) 
end 
end 
addCommandHandler ("take", ta) 

Dosn't work :|

Plase help, thanks!

Link to comment

Use [ lua][ /lua]

I'm not sure what's wrong, what is the problem exactly?

function take(thePlayer, command, who, amount) 
    local taker = getPlayerName ( thePlayer ) 
    local takeFrom = getPlayerFromName ( who ) 
    if takeFrom and isObjectInACLGroup ( "user." .. taker, aclGetGroup ( "Admin" ) ) then 
        takePlayerMoney (takeFrom, math.abs(tonumber(amount))) 
    end 
end 
addCommandHandler ("take", take) 

Link to comment
function take(thePlayer, command, who, amount) 
    local takeFrom = getPlayerFromName ( who ) 
    if takeFrom and isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ( "Admin" ) ) then 
    takePlayerMoney (takeFrom, math.abs(tonumber(amount))) 
    end 
end 
addCommandHandler ("take", take) 

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