NPC_GetSkin
注意
This function was added in omp v1.5.8.3079 and will not work in earlier versions!
Description
Gets the skin/model ID of an NPC.
| Name | Description |
|---|---|
| npcid | The ID of the NPC |
Returns
Returns the skin/model ID of the NPC, or -1 if invalid.
Examples
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkskin", 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 skinid = NPC_GetSkin(npcid);
SendClientMessage(playerid, 0x00FF00FF, "NPC %d skin: %d", npcid, skinid);
return 1;
}
return 0;
}
Notes
- Returns the current skin/model the NPC is using
- Use NPC_SetSkin to change the NPC's skin
Related Functions
- NPC_SetSkin: Set NPC skin/model
- NPC_IsValid: Check if NPC is valid
- NPC_IsSpawned: Check if NPC is spawned
Related Callbacks
- OnNPCSpawn: Called when NPC spawns