---
title: "SetVehicleParamsCarDoors | open.mp"
description: "控制车辆车门的开关状态。"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/SetVehicleParamsCarDoors
language: zh-CN
---

# SetVehicleParamsCarDoors

注意

这个函数是在SA-MP 0.3.7中添加的，在以前的版本中不起作用！

## 描述

控制车辆车门的开关状态。

| 参数 | 说明 |
| --- | --- |
| vehicleid | 要设置车门状态的车辆 ID |
| bool:frontLeft | 驾驶座车门状态（1 开启/0 关闭） |
| bool:frontRight | 副驾驶车门状态（1 开启/0 关闭） |
| bool:rearLeft | 左后车门状态（若存在）（1 开启/0 关闭） |
| bool:rearRight | 右后车门状态（若存在）（1 开启/0 关闭） |

## 返回值

**true** - 函数执行成功

**false** - 函数执行失败（指定的车辆不存在）

## 相关函数

-   [GetVehicleParamsCarDoors](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/GetVehicleParamsCarDoors): 获取当前车辆车门状态
-   [SetVehicleParamsCarWindows](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/SetVehicleParamsCarWindows): 控制车辆车窗开关状态
-   [GetVehicleParamsCarWindows](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/GetVehicleParamsCarWindows): 获取当前车辆车窗状态
