Ga naar hoofdinhoud

NPC_GetCustomSkin

waarschuwing

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

Description

Gets the custom skin ID of an NPC.

NameDescription
npcidThe ID of the NPC

Returns

Returns the custom skin ID of the NPC, or -1 if the NPC has no custom skin or is invalid.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkcustomskin", 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 customskinid = NPC_GetCustomSkin(npcid);

if (customskinid == -1)
{
SendClientMessage(playerid, 0xFF0000FF, "NPC %d has no custom skin set", npcid);
}
else
{
SendClientMessage(playerid, 0x00FF00FF, "NPC %d custom skin: %d", npcid, customskinid);
}
return 1;
}
return 0;
}

Notes

waarschuwing
  • Returns -1 if the NPC has no custom skin set or if the NPC is invalid.
  • Custom skins differ from regular skins in that they typically refer to custom models added to the game.
  • Use NPC_GetSkin to get the regular skin/model ID.