Jump to content

getElement* bad arguments


Recommended Posts

I have problem with this:

function getMoney(thePlayer, nocheck) 
    if not nocheck then 
        checkMoneyHacks(thePlayer) 
    end 
    [u][b][132]return getElementData(thePlayer, "money") or 0[/b][/u] 
end 
  
function checkMoneyHacks(thePlayer) 
    [u][b][136]if not getMoney(thePlayer, true) or getElementType(thePlayer) ~= "player" then return end[/b][/u] 
     
    local safemoney = getMoney(thePlayer, true) 
    local hackmoney = getPlayerMoney(thePlayer) 
    if (safemoney < hackmoney) then 
        setPlayerMoney(thePlayer, safemoney) 
        sendMessageToAdmins("Possible money hack detected: "..getPlayerName(thePlayer)) 
        return true 
    else 
        return false 
    end 
end 

My warring is:

[11:00:27] WARNING: global/s_money_globals.lua:132: Bad argument @ 'getElementDa 
ta' [Expected element at argument 1, got boolean] 
[11:00:27] WARNING: global/s_money_globals.lua:136: Bad argument @ 'getElementTy 
pe' 
[11:00:27] WARNING: global/s_money_globals.lua:132: Bad argument @ 'getElementDa 
ta' [Expected element at argument 1, got boolean] 
  

Whats wrong?

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