NPC_SetVehicleHydraThrusters
注意
这个函数是在omp v1.5.8.3079中添加的,在以前的版本中不起作用!
描述
设置 NPC 驾驶九头蛇战机时的推进器方向。
| 参数 | 说明 |
|---|---|
| npcid | NPC 的 ID |
| direction | 推进器方向(0=向前,1=向下) |
返回值
如果操作成功则返回true,否则返回false。
示例
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/sethydrathrusters ", true, 19))
{
new npcid = PlayerNPC[playerid];
if (npcid == INVALID_NPC_ID)
return SendClientMessage(playerid, 0xFF0000FF, "你没有在调试NPC。");
if (!NPC_IsValid(npcid))
return SendClientMessage(playerid, 0xFF0000FF, "无效的NPC。");
new direction = strval(cmdtext[19]);
NPC_SetVehicleHydraThrusters(npcid, direction);
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 九头蛇战机推进器方向设置为 %d", npcid, direction);
return 1;
}
return 0;
}
注意事项
- 仅适用于 Hydra 飞机(车辆 ID 520)
- 方向 0 = 向前推进器(喷气模式)
- 方向 1 = 向下推进器(垂直起降 模式)
- 使用 NPC_GetVehicleHydraThrusters 检查当前方向
相关函数
- NPC_GetVehicleHydraThrusters: 获取推进器方向
- NPC_GetVehicleID: 获取 NPC 的车辆
- NPC_PutInVehicle: 将 NPC 放入车辆
- GetVehicleModel: 获取车辆模型
相关回调
此函数不会触发任何特定的回调。