Jump to content

Vehicle Engine dont be turned off


noOx

Recommended Posts

Hi, i have scripted a Engine-Toggle. But the Engine will not turned off.

The Source

function vehicleEngineToggle(source)
    playerVehicle = getPedOccupiedVehicle(source)
    playerSeat = getPedOccupiedVehicleSeat(source)
    engineState = getVehicleEngineState(playerVehicle)
    if (playerVehicle) then
        if (playerSeat == 0) then
            if (engineState == true) then
                setVehicleEngineState(playerVehicle, false)
                outputChatBox("Motor ausgeschaltet", source, 0, 200, 0, true)
                return
            else
                setVehicleEngineState(playerVehicle, true)
                outputChatBox("Motor eingeschaltet", source, 0, 200, 0, true)
            end
        else
            outputChatBox("Du bist nicht der Fahrer des Fahrzeugs", source, 200, 0, 0, true)
        end
    else
        outputChatBox("Du sitzt in keinem Fahrzeug", source, 200, 0, 0, true)
    end
end
addCommandHandler("motor", vehicleEngineToggle, false, false)

I dont get a error or something.

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