pejczi Posted July 17, 2013 Author Share Posted July 17, 2013 Yeah, now works Thanks, i didn't know how to make negation Link to comment
denny199 Posted July 18, 2013 Share Posted July 18, 2013 No problem, also here are some exaples for a "not" statement, since "not" is very handy it can be used for changing "true" and "false" like here: variable = false addCommandHandler ( "chekState", function () local status = not variable outputChatBox ( status ) --will return "true" end) --or addCommandHandler ( "chekState2", function () variable = not variable outputChatBox ( status ) --will return "true" or "false" since it will overwrite the variable with the not statement end) Also you can use it with some returns of the default functions of mta, let's take "guiGetVisible" Usage: bindKey ( "f1", "down", function () local show = not(guiGetVisible ( guiElement )) guiSetVisible ( guiElement, show ) showCursor ( show ) end) This 'not' statement might be faster than checking with "if" and "elseif" statements. Also, keep the scripting up, feel free to ask more @ the forums, we are loving to help you Kindly regards, Danny Link to comment
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