Jump to content

this cancelEvent Doesnt work?


mrvicio

Recommended Posts

Posted

hi all this is my first post ^^

im trying to cancel the event "onTrailerAtach"

  
addEventHandler("onTrailerAtach",getRootElement(),function() 
cancelEvent() 
  
end) 
  

but to me, it doesnt work, someone have tried it?

Posted

Maybe it doesn't work because is "onTrailerAttach" not "onTrailerAtach"...?

addEventHandler("onTrailerAttach",getRootElement(),function() 
cancelEvent() 
end) 

Posted

There is, check the wiki.

If this event is canceled, the trailer will detach from the truck again.
Posted

It's suppose to work Server-side...

Try this:

addEventHandler("onTrailerAttach",getRootElement(), 
function() 
wasEventCancelled(canelEvent()) 
end) 

Posted
It's suppose to work Server-side...

Try this:

addEventHandler("onTrailerAttach",getRootElement(), 
function() 
wasEventCancelled(canelEvent()) 
end) 

Seriously what are you posting, wasEventCancelled is used to check if the even was cancelled, and it doesn't have any arguments.

Posted

it's just like the isCursorShowing(showCursor()).

But I'll change it:

addEventHandler("onTrailerAttach",getRootElement(), 
function() 
if ( not wasEventCancelled() ) then 
cancelEvent() 
end) 

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...