Stranger Posted August 30, 2014 Posted August 30, 2014 hello , i'm working on vehicle shop so i'm trying to make when the vehicle get destroyed the color of the vehicle saved on the sql when i do the UPDATE in the sql so it shows on the database in the color's column the price of the vehicle at each one of the column i've tried so many ways but not one of those ways works with me, so help here is the code: executeSQLQuery ("UPDATE `Vehs` SET `ColorR` = ?, `ColorG` = ?, `ColorB` = ?, `cost` = ? WHERE `Account` = ? AND `Model` = ?", r, g, b, cost, getPlayerAccount (source), id) i guess the problem only here so,
'LinKin Posted August 30, 2014 Posted August 30, 2014 What error does the debug output? Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Anubhav Posted August 30, 2014 Posted August 30, 2014 executeSQLQuery ("UPDATE `Vehs` SET `ColorR` = ?, `ColorG` = ?, `ColorB` = ?, `cost` = ? WHERE `Account` = ? AND `Model` = ?", r, g, b, cost, tostring(getAccountName(getPlayerAccount (source))), id) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
'LinKin Posted August 30, 2014 Posted August 30, 2014 I see no error on that line, unless the variables you define aren't what you think they are. Re-check them Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Stranger Posted August 30, 2014 Author Posted August 30, 2014 but there is a problem, why in the database if i change the colors of the vehicle, like: 255, 0, 0 it shows on the database like this 3, 0, 0, and if i change it to 0, 255, 0 it shows like: 65, 0, 0 i don't know why !!!
'LinKin Posted August 30, 2014 Posted August 30, 2014 What are the columns' types that you defined when you created the table? Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
'LinKin Posted August 30, 2014 Posted August 30, 2014 (edited) Well, if they are TEXT, then you need to do somethig like: executeSQLQuery ("UPDATE `Vehs` SET `ColorR` = ?, `ColorG` = ?, `ColorB` = ?, `cost` = ? WHERE `Account` = ? AND `Model` = ?", tostring(r), tostring(g), tostring(b), cost, getAccountName(getPlayerAccount (source)), id) EDIT: You don't need tostring(getAccountName(getPlayerAccount (source))) because getAccountName returns a string by default. Edited August 30, 2014 by Guest Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Anubhav Posted August 30, 2014 Posted August 30, 2014 yea thanks, solved. No problem. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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