Jump to content

No Damage Car /brake


Recommended Posts

function handbrake (player)
	local veh = getPedOccupiedVehicle(player)
	local freezestatus = isElementFrozen(veh)
	if isPedInVehicle(player) then
		if getPedOccupiedVehicleSeat(player) == 0 then
			if freezestatus == false then
				setElementFrozen(veh,true)
				outputChatBox("Die Handbremese wurde angezogen!", player, 200, 0, 0)
			elseif freezestatus == true then
				setElementFrozen(veh,false)
				outputChatBox ( "Die Handbremese wurde gelöst!", player, 200, 0, 0 )
			end
		end
	end
end
addCommandHandler("brake",handbrake

Please give me that command so the car doesn't get damaged.

 

Link to comment
  • 4 weeks later...

You can try this

 

addCommandHandler( "brake",
    function ( thePlayer )
            local theVehicle = getPedOccupiedVehicle( thePlayer )
            if ( theVehicle ) then
                if ( isVehicleDamageProof( theVehicle ) ) then
        			outputChatBox("Your vehicle is no longer damageproof!", thePlayer, 0, 255, 0)
                    setVehicleDamageProof( theVehicle, false )
                else
      				  outputChatBox("Your vehicle is now damageproof!", thePlayer, 0, 255, 0)
                    setVehicleDamageProof( theVehicle, true )
                end
            end
        end
)

 

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