Sasu Posted September 13, 2014 Posted September 13, 2014 Is there a better way to output an error message on debugscript instead of make a lot of if's conditional? function dxCreateWindow ( x, y, width, height, titleBarText, relative, windowBarColor, windowColor ) if type(x) == "number" then if type(y) == "number" then if type(width) == "number" then if type(height) == "number" then if type(titleBarText) == "string" then if type(relative) == "number" then -- else return outputDebugString("[dxCreateWindow]: expected number at argument 6, got "..type(relative), 3) end else return outputDebugString("[dxCreateWindow]: expected string at argument 5, got "..type(titleBarText), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 4, got "..type(height), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 3, got "..type(width), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 2, got "..type(y), 3) end else return outputDebugString("[dxCreateWindow]: expected number at argument 1, got "..type(x), 3) end end State: Inactive
Anubhav Posted September 13, 2014 Posted September 13, 2014 error 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
DNL291 Posted September 14, 2014 Posted September 14, 2014 You can use this function: assert Please do not PM me with scripting related question nor support, use the forums instead.
Sasu Posted September 15, 2014 Author Posted September 15, 2014 You can use this function: assert Thank you State: Inactive
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