پرش به مطلب اصلی

NPC_GetSurfingOffset

هشدار

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

Description

Gets the surfing offset for an NPC.

NameDescription
npcidThe ID of the NPC
&xA variable to store the X offset, passed by reference
&yA variable to store the Y offset, passed by reference
&zA variable to store the Z offset, passed by reference

Returns

Returns true if the operation was successful, false otherwise.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checksurfingoffset", 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.");

new Float:offsetX, Float:offsetY, Float:offsetZ;
NPC_GetSurfingOffset(npcid, offsetX, offsetY, offsetZ);

SendClientMessage(playerid, 0x00FF00FF, "NPC %d surfing offset: X=%.2f, Y=%.2f, Z=%.2f", npcid, offsetX, offsetY, offsetZ);
return 1;
}
return 0;
}

Notes

  • The surfing offset represents the relative position of the NPC compared to the object/vehicle it's surfing on
  • All offset values are returned as floating-point numbers

No specific callbacks are triggered by this function.