Jump to content

Problem with event


Neproify

Recommended Posts

Hi! I have code like this:

  
addEventHandler("onPlayerQuit", root, function() 
    local charInfo = getElementData(source, "charInfo") 
    if not charInfo then return end 
    local money = getPlayerMoney(source) 
    outputDebugString(money) 
    exports.rp_db:zapytanie("UPDATE rp_characters SET skin=? AND money=? WHERE UID=?", charInfo.skin, getPlayerMoney(source), charInfo.UID) 
end) 
  

And the money variable is 0... When I got $500 In Game... So, what's problem?

Link to comment

Now the money variable is... Correct. I setPlayerMoney serverside, not clientside, like before.

But now i have other problem. The query to database:

2014-09-24 20:11:24.861: [script] SUCCESS: Affected rows:0 [Query:UPDATE `rp_characters` SET `skin`=0 AND `money`=0 WHERE `UID`=1] 

Is "success", but I don't see changes in phpmyadmin...

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