跳到主要内容

NPC_SetVehicleHydraThrusters

注意

这个函数是在omp v1.5.8.3079中添加的,在以前的版本中不起作用!

描述

设置 NPC 驾驶九头蛇战机时的推进器方向。

参数说明
npcidNPC 的 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 检查当前方向

相关函数

相关回调

此函数不会触发任何特定的回调。