Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Death with inventory item.
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#5
RE: Death with inventory item.

(08-22-2011, 06:27 PM)Homicide13 Wrote: This works...except the new item doesn't have a CustomSubItemTypeName, so it doesn't display any information in the inventory :/ I can't find a command that will change this on an item.

Also, is there a way to check if an entity is in somebody's inventory? I assume there would be, but all I can find is bool GetEntityExists(string& asName);, which would just return true either way.

You just add a local variable that's attached to a SetEntityPlayerInteractCallback. Like so:

void OnStart()
{
     SetLocalVarInt("Var01", 0);
     SetEntityPlayerInteractCallback("ItemName", "Func01", false);
     if ((GetPlayerHealth() <= 0) && (GetLocalVarInt("Var01") == 1))
     {
          RemoveItem("ItemName");
          SetEntityActive("ItemName", true); //Or change this to make it work with CreateEntityAtArea.
     }
}
void Func01(string &in asEntity)
{
     SetLocalVarInt("Var01", 1);
}

(This post was last modified: 08-22-2011, 06:44 PM by Kyle.)
08-22-2011, 06:41 PM
Find


Messages In This Thread
Death with inventory item. - by Homicide13 - 08-22-2011, 03:50 PM
RE: Death with inventory item. - by Tanshaydar - 08-22-2011, 03:58 PM
RE: Death with inventory item. - by Kyle - 08-22-2011, 03:58 PM
RE: Death with inventory item. - by Homicide13 - 08-22-2011, 06:27 PM
RE: Death with inventory item. - by Kyle - 08-22-2011, 06:41 PM
RE: Death with inventory item. - by Homicide13 - 08-22-2011, 08:17 PM
RE: Death with inventory item. - by Kyle - 08-22-2011, 08:44 PM
RE: Death with inventory item. - by Homicide13 - 08-22-2011, 08:55 PM



Users browsing this thread: 1 Guest(s)