Make it easy try this server side :
function SwitchEngine( playerSource )
local theVehicle = getPedOccupiedVehicle ( playerSource )
if theVehicle and getVehicleController ( theVehicle ) == playerSource then
local state = getVehicleEngineState ( theVehicle )
setVehicleEngineState ( theVehicle, not state )
end
end
function BindKeys ( player )
if ( eventName == "onVehicleStartEnter" ) then
bindKey ( player,"x","down",SwitchEngine )
else
unbindKey ( player,"x","down",SwitchEngine )
end
end
addEventHandler ( "onVehicleStartEnter", root, BindKeys )
addEventHandler ( "onVehicleStartExit", root, BindKeys )
Not tested yet .