Nightmare12 Posted June 26, 2012 Share Posted June 26, 2012 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
TAPL Posted June 26, 2012 Share Posted June 26, 2012 It's look like thePlayer is not defined i can't see how you're using this function or what event are you using. Link to comment
Nightmare12 Posted June 26, 2012 Author Share Posted June 26, 2012 I use function above with this code: exports.global:checkMoneyHacks(client) When char spawn Link to comment
TAPL Posted June 26, 2012 Share Posted June 26, 2012 I use function above with this code: exports.global:checkMoneyHacks(client) When char spawn what is char spawn? show entire code, still can't see from where client coming. https://wiki.multitheftauto.com/wiki/AddEventHandler client: the client that triggered the event using triggerServerEvent. Not set if the event was not triggered from a client. Link to comment
Nightmare12 Posted June 26, 2012 Author Share Posted June 26, 2012 addEventHandler("accounts:characters:spawn", getRootElement(), spawnCharacter) function spawnCharacter(characterID) ...(another code)... exports.global:checkMoneyHacks(client) ...(another code)... And code with error is in posts above 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