Jump to content

Engine problem


Desaster

Recommended Posts

I couldn't specify the seat of the driver I tryed this and many other this but it won't work help me pls

function engineSwitch1 () 
    if (seat == 0) then -- the error is here 
        if (isPedInVehicle (source)) then 
     
            local veh = getPedOccupiedVehicle (source) 
            if (getVehicleEngineState (veh) == true) then 
                setVehicleEngineState (veh, false) 
                outputChatBox ("Vehicle shutted down.", source, 255, 0, 0) 
            elseif (getVehicleEngineState (veh) == false) then 
                setVehicleEngineState (veh, true) 
                outputChatBox ("Vehicle started.", source, 255, 0, 0) 
            end 
        else 
            outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) 
        end 
    else 
        outputChatBox ("You aren't the Driver of this Vehicle!", source, 255, 0, 0) 
    end 
end 
addEvent("engenieSwitch1",true) 
addEventHandler("engenieSwitch1",getRootElement(),engineSwitch1) 
  

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