Got a couple of questions related to looting, I'm trying to determine the owner of things like corpses and backpacks, or at least working out if they are player owned.
Basically I want to log three things:
- Looting a sleeping player
- Looting of player corpse
- Looting of player backpack
void OnLootEntity(BasePlayer initiator, BaseEntity entity) {
if (entity != null) {
string prefab = entity.ShortPrefabName;
if (entity is BasePlayer) {
var looted = entity.ToPlayer();
Puts(initiator + " looted " + looted);
} else if (prefab == "player_corpse") {
Puts(initiator + " looted a dead body"); // Want "Louise looted a corpse belonging to Jane"
} else if (prefab == "item_drop_backpack") {
Puts(initiator + " looted a backpack"); // Want "John looted a backpack belonging to Jim"
}
}
}As always, any help with this appreciated :D