overlocus Posted August 18, 2018 Share Posted August 18, 2018 hi guys . i want Vehicles cant be pushed by on foot. can you help me Link to comment
Moderators IIYAMA Posted August 18, 2018 Moderators Share Posted August 18, 2018 I don't think that is possible by default. do local vehicles = getElementsByType("vehicle") for i=1, #vehicles do local vehicle = vehicles[i] setElementFrozen(vehicle, true) end end You can freeze the vehicles, but that also means you can't drive them any more. https://wiki.multitheftauto.com/wiki/SetElementFrozen Or you could make the vehicles more heavy, with: (recommend this one) https://wiki.multitheftauto.com/wiki/SetModelHandling Or you can remove the collision between the players and the vehicles: https://wiki.multitheftauto.com/wiki/SetElementCollidableWith Link to comment
JeViCo Posted August 18, 2018 Share Posted August 18, 2018 try this addEventHandler("onClientElementStreamIn", getRootElement(), function() if getElementType(source) == "vehicle" then #getVehicleOccupants(source) == 0 then setElementFrozen(source,true) end end end) addEventHandler("onClientVehicleEnter", getRootElement(),function() if #getVehicleOccupants(source) == 1 then -- not sure right here (check if car empty) setElementFrozen(source,false) end end) @overlocus 1 Link to comment
JustinMTA Posted August 18, 2018 Share Posted August 18, 2018 (edited) You can find default .COL files on the net for all GTA vehicles, if I were you, I'd try loading the .COL to a trashcan object or something, then attach the trashcan to the car using attachElement, then make the trashcan invisible using .TXD or shaders, not sure if .COL created for vehicles will load to regular objects though.. If it crashes MTA you must create your own .COL file using 3DS Max or there's other programs that can create .COL as well, but harder to use in my opinion. The code above will probably work also Edited August 18, 2018 by JustinMTA Link to comment
MisterQuestions Posted August 27, 2018 Share Posted August 27, 2018 Freezing on exit should be enough to satisfact what you're asking for. Unfreeze only when entering and there's a player on driver's seat Link to comment
Dzsozi (h03) Posted September 4, 2018 Share Posted September 4, 2018 I suggest you using https://wiki.multitheftauto.com/wiki/OnClientVehicleCollision Link to comment
Simple0x47 Posted September 4, 2018 Share Posted September 4, 2018 On 18/08/2018 at 18:53, JustinMTA said: You can find default .COL files on the net for all GTA vehicles, if I were you, I'd try loading the .COL to a trashcan object or something, then attach the trashcan to the car using attachElement, then make the trashcan invisible using .TXD or shaders, not sure if .COL created for vehicles will load to regular objects though.. If it crashes MTA you must create your own .COL file using 3DS Max or there's other programs that can create .COL as well, but harder to use in my opinion. The code above will probably work also No sense, but nvm. 2 Link to comment
JustinMTA Posted September 5, 2018 Share Posted September 5, 2018 4 hours ago, Simple01 said: No sense, but nvm. Or maybe you don't have an imagination xD 1 Link to comment
Simple0x47 Posted September 5, 2018 Share Posted September 5, 2018 8 hours ago, JustinMTA said: Or maybe you don't have an imagination xD I've got imagination but that thing wouldn't work out. 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