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
Script Help [SOLVED] Using a Single Crowbar on Multiple Doors
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#5
RE: Using a Single Crowbar on Multiple Doors

Basically you write a regular use item function and put all these things in there. Here's a breef example.

void UseCrowbarOnDoor(string &in asEntity, string &in asItem)
{
      if(asEntity == "mansion_1")
      {
           SetPropHealth(asEntity); //Break the door (for some reason)
      }
      else if(asEntity == "mansion_2")
      {
           SetEntityActive("crowbar", true); //Some simple activate entity
      }
}

void OnStart()
{
     for(int i=1; i<=4; ++i) AddUseItemCallback("crowbarondoors", "crowbar", "mansion_"+i, "UseCrowbarOnDoor", false);
}

Go ahead and ask me if theres anything you don't entirely understand about the script.

Derp.
09-21-2014, 09:47 PM
Find


Messages In This Thread
RE: Using a Single Crowbar on Multiple Doors - by Neelke - 09-21-2014, 09:47 PM



Users browsing this thread: 1 Guest(s)