I know it's possible to add or remove items from a `PlayerCorpses` `containers`. It has 3 containers and you can put whatever items you want in there.
However how do I actually alter the way the corpse looks on the ground? For example if I have a scientist corpse how do I turn the corpse into a naked body? Even when all 3 of his containers are empty he is still wearing a blue scientist suit.
Alter what NPC corpses are wearing?
However how do I actually alter the way the corpse looks on the ground? For example if I have a scientist corpse how do I turn the corpse into a naked body?
BasePlayer.inventory.containerWear.Clear(); ?
How do I get the BasePlayer from a corpse?
For example below (BasePlayer is always null):
void OnItemRemovedFromContainer(ItemContainer container, Item item)
{
// STrip the corpse when clothes are removed
if (container.entityOwner != null && container.entityOwner is PlayerCorpse)
{
PlayerCorpse corpse = (PlayerCorpse)container.entityOwner;
BasePlayer player = container.playerOwner;
if (player == null)
{
Puts("NULL PLAYER!");
}
else
{
player.inventory.containerWear.Clear();
}
}
} You can get the player steam ID with
corpse.playerSteamIDwhich you can use to find the player using the static methods in BasePlayer.
I need it to work for NPCs...so how do I strip a scientist corpse down to a naked? (won't have a steamID right?)