Jump to content

Problem with event


Neproify

Recommended Posts

Posted

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?

Posted

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

Posted

Affected rows:0

IT means that it received the mysql query and it is correct [syntax] but there were another problems? No row with UID = 1 ? missing collumns money , skin?

Posted

Nope. Query in phpmyadmin(I use: UPDATE `rp_characters` SET `skin`=0 AND `money`=0 WHERE `UID`=1) Is correct. It works. But in MTA this same query doesn't work... But why?

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