انتقل إلى المحتوى الرئيسي

NPC_GetVehicleHydraThrusters

warning

This function was added in omp v1.5.8.3079 and will not work in earlier versions!

Description

Gets the thruster direction of an NPC's Hydra vehicle.

NameDescription
npcidThe ID of the NPC

Returns

Returns the thruster direction (0 = forward, 1 = vertical), or -1 if not in a Hydra.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkvehiclehydra", true))
{
new npcid = PlayerNPC[playerid];
if (npcid == INVALID_NPC_ID)
return SendClientMessage(playerid, 0xFF0000FF, "You are not debugging a NPC.");

if (!NPC_IsValid(npcid))
return SendClientMessage(playerid, 0xFF0000FF, "Invalid NPC.");

if (NPC_GetVehicle(npcid) == INVALID_VEHICLE_ID)
return SendClientMessage(playerid, 0xFFFF00FF, "NPC %d is not in any vehicle.", npcid);

new thrusters = NPC_GetVehicleHydraThrusters(npcid);

if (thrusters == 0)
SendClientMessage(playerid, 0x00FF00FF, "NPC %d: Hydra thrusters FORWARD (0)", npcid);
else
SendClientMessage(playerid, 0x00FF00FF, "NPC %d: Hydra thrusters BACKWARD (1)", npcid);

return 1;
}
return 0;
}

Notes

  • Only works with Hydra vehicles (model 520)
  • Returns -1 if the NPC is not in a Hydra or not in a vehicle
  • Direction 0 = forward flight mode (jet mode)
  • Direction 1 = vertical flight mode (hover mode)

No specific callbacks are triggered by this function.