Lewati ke konten utama

NPC_GetSkin

peringatan

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.

NameDescription
npcidThe 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