PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Making Hammer and Chipper break open door?
(04-21-2013, 02:59 PM)serbusfish Wrote: For some reason it wont work, it just says I cant use the item here. Here is my inventory code just for reference:
//COMBINE HAMMER//
////////////////////
void hammer_chipper(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);
RemoveItem(asItemA); RemoveItem(asItemB);
GiveItem("stone_hammer_chipper", "Puzzle", "stone_hammer_chipper", "stone_hammer_chipper.tga", 0);
}
////////////////////////////
// Run at the start of the game.
void OnGameStart()
{
/////HAMMER & CHIPPER COMBO/////
AddCombineCallback("hammer_chipper", "hammer_1", "chipper_1", "hammer_chipper", false);
}
And how I used your code:
void OnStart()
{
AddUseItemCallback("", "hammer_chipper", "RustyLock", "DoorUnlockAnim", true);
}
void DoorUnlockAnim(string &in asItem, string &in asEntity)
{
SetPropHealth("RustyLock", 5.0f); //Door is hit with damage too as you explained it. Change doorname to what ever your door's name is.
SetSwingDoorLocked("RustyLock", false, false); //Change doorname to whatever your door's name is.
PlaySoundAtEntity("", "break_wood_metal.snt", "Player", 0.0f, false); //Change LOCKBREAK.snt to the sound of a lock broken with the extension .snt.
SetEntityActive("hammer_1", true); //Hammer.
SetEntityActive("chipper_1", true); //Chipper.
AddTimer("", 1.4f, "HammerChipperMove");
}
void HammerChipperMove(string &in asTimer)
{
SetMoveObjectState("hammer_1", 0.40);
SetMoveObjectState("chipper_1", 0.40);
AddTimer("", 1.1f, "HammerChipperMove2");
}
void HammerChipperMove2(string &in asTimer)
{
SetMoveObjectState("hammer_1", 0.1f);
SetMoveObjectState("chipper_1", 0.1f);
AddTimer("", 0.5f, "TimerLoop");
}
void TimerLoop(string &in asTimer)
{
AddTimer("", 0.2f, "HammerChipperMove");
AddTimer("", 0.3f, "HammerChipperMove2");
AddTimer("", 2.4f, "HammerChipperEnd"); //Change 2.4f to how long you want the smashing process to endure.
}
void HammerChipperEnd(string &in asTimer)
{
SetEntityActive("hammer_1", false);
SetEntityActive("chipper_1", false);
RemoveTimer("HammerChipperMove");
RemoveTimer("HammerChipperMove2");
}
^I removed the lock from it as I only have a Cellar door, not a gate with the lock prop. It seems like you're using it on the wrong entity. You must used it with an entity under the name "RustyLock".
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|