Jump to content

Move Vehicle. (Race/DD)


pejczi

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...