Anubhav Posted October 11, 2014 Posted October 11, 2014 if x ~= "x" then if not tonumber(tostring(x)) then return outputChatBox("*X value must be in number!", client, 255, 0, 0) end executeSQLQuery( "UPDATE teleportData SET x=? WHERE command=?", tonumber(tostring(x)), oc ) end This is my piece of a code. See here, x is the value of guiGetText ( i triggered. ) Ok so the problem starts My x's test it x still it goes infront and returns *X value must be in number! What's wrong? 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
darhal Posted October 11, 2014 Posted October 11, 2014 Use if type(x) == 'number' then outputChatBox('X must be number') return end #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Anubhav Posted October 11, 2014 Author Posted October 11, 2014 Thanks alot! 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
darhal Posted October 11, 2014 Posted October 11, 2014 You are welcome #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Saml1er Posted October 11, 2014 Posted October 11, 2014 Btw there's no need to use tostring when calling tonumber. print ( type ( tonumber ( tostring ('"6"') ) ) ) --> nil print ( type ( tonumber ('"6"' ) ) ) --> nil So it's pointless because you get the same result.
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