GTX Posted April 13, 2013 Posted April 13, 2013 Hello. I have problem with colliding vehicles. Well, here's picture: http://shrani.si/f/33/5z/3ObG7iTG/mta-s ... 1400-2.png As you can see in the picture, vehicles can't collide correctly. Code: function col() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then for i,v in ipairs(getElementsByType("vehicle")) do setElementCollidableWith(vehicle, v, false) end end end addEventHandler("onClientRender", root, col) Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
50p Posted April 13, 2013 Posted April 13, 2013 You haven't explained what you're trying to do. Besides, you don't have to change collidable state every frame. That's overkill. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
codeluaeveryday Posted April 14, 2013 Posted April 14, 2013 instead use this, because your code looks normal to the vehicle element, but not to the other element. function col() for k, z in ipairs(getElementsByType("vehicle")) do for i,v in ipairs(getElementsByType("vehicle")) do setElementCollidableWith(k, v, false) end end end addEventHandler("onClientRender", root, col) You probably should use setTimer, and make it every 500 ms. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
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