NPC_IsStreamedIn
cảnh báo
Đã thêm hàm trong phiên bản omp v1.5.8.3079. Mục này không hoạt động trên các phiên bản cũ hơn!
Description
Checks if an NPC is streamed in for a specific player.
| Name | Description |
|---|---|
| npcid | The ID of the NPC |
| playerid | The ID of the player to check |
Returns
Returns true if the NPC is streamed in for the player, false otherwise.
Examples
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkstreamedin", 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 bool:isStreamedIn = NPC_IsStreamedIn(npcid, playerid);
SendClientMessage(playerid, 0x00FF00FF, "NPC %d is streamed in for you: %s", npcid, isStreamedIn ? "Yes" : "No");
return 1;
}
return 0;
}
Notes
- NPCs are only streamed in when within the player's streaming distance
- Streaming depends on distance and interior/virtual world matching
Related Functions
- NPC_IsAnyStreamedIn: Check if any player can see NPC
- NPC_SetPos: Set NPC position
Related Callbacks
No specific callbacks are triggered by this function.