Nervly
Junior Member
Posts: 40
Threads: 2
Joined: Feb 2012
Reputation:
0
|
RE: 3 Questions: Cave In and Destroying bookshelf
(06-21-2012, 02:56 PM)FastHunteR Wrote: Same as the bookshelf, just with true.
SetEntityActive("nameofcavein", true);
If you don't look directly to the cave in when you enter that area, you can leave it by that and a PlaySoundAtEntity function for the cave in sound. If you do look directly though, use FadeOut() and FadeIn() just like for that bookshelf. Ok, thanks a lot for all your help! ^^
I'll set the books, etc. to inactive now that I know the command, and I'll take care of the cave_in.
+1 Rep again
EDIT:
The books, etc. are not disappearing. I copied their names, so I guess that's not the problem.
Here is the script:
Quote:void OnStart()
{
AddUseItemCallback("", "stone_hammer_1", "shelf", "DestroyShelf", true);
}
void DestroyShelf(string &in asItem, string &in asEntity)
{
//Do your stuff, whatever you want to do, here. Example:
FadeOut(2);
AddTimer("Timer_1", 2, "PlaySound");
}
void PlaySound(string &in asTimer)
{
PlaySoundAtEntity("", "break_wood.snt", "shelf", 0, false);
SetEntityActive("shelf", false);
SetEntityActive("book_row02_1", false);
SetEntityActive("book_row01_2", false);
SetEntityActive("book_pile01_1", false);
SetEntityActive("candlestick01_4", false);
SetEntityActive("book_row03_1", false);
SetEntityActive("book_open_1", false);
SetEntityActive("book_row02_2", false);
SetEntityActive("book_pile02_1", false);
SetEntityActive("book_pile01_2", false);
SetEntityActive("book_row02_3", false);
SetEntityActive("candlestick01_2", false);
SetEntityActive("candlestick01_3", false);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}
(This post was last modified: 06-21-2012, 03:28 PM by Nervly.)
|
|
06-21-2012, 03:06 PM |
|