Jump to content

setElementCollidableWith = crash?


botanist

Recommended Posts

Posted
crun setElementCollidableWith ( getPedOccupiedVehicle(localPlayer), getElementsByType("vehicle"), false ) 

When doing that with Runcode, my game crashes. Wtf? My fault, or bug?

Posted

The second parameter of this function is invalid in your case. As the wiki says, it should be an element (but getElementsByType returns a table). So I think that this function crashes the client if invalid parameters were passed in it.

for i, v in ipairs( getElementsByType( 'vehicle' ) ) do 
  setElementCollidableWith( getPedOccupiedVehicle(localPlayer), v, false ) 
end 

Should work fine.

Posted
  
crun for ind, car in pairs(getElementsByType("vehicle")) do 
setElementCollidableWith(getPedOccupiedVehicle(localPlayer), car, false) 
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...