Jump to content

Vehicles cant be pushed by on foot.


overlocus

Recommended Posts

  • Moderators

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

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

  • Like 1
Link to comment

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 xD

Edited by JustinMTA
Link to comment
  • 2 weeks later...
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 xD

No sense, but nvm.

  • Haha 2
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...