Neproify Posted September 24, 2014 Posted September 24, 2014 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?
Dimos7 Posted September 24, 2014 Posted September 24, 2014 try change the soure to thePlayer may it work
Neproify Posted September 24, 2014 Author Posted September 24, 2014 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...
XFawkes Posted September 24, 2014 Posted September 24, 2014 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?
Neproify Posted September 25, 2014 Author Posted September 25, 2014 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?
lcd1232 Posted September 25, 2014 Posted September 25, 2014 maybe try use instead of `` this '' or this ""
Anubhav Posted September 25, 2014 Posted September 25, 2014 maybe try use instead of `` this '' or this "" Are you mad? Its SQL.
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