RE: i need some help/ explaination
void OnStart()
{
AddUseItemCallback("Player", "DoorLocked", "DoorOpenSlamming", "DOORopen", true);
AddUseItemCallback("", "DoorLocked", "SlammingSound", "DOORopenSOUND", true);
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
RemoveItem(asItem);
}
void DOORopen(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("DoorOpenSlamming", false, false);
SetSwingDoorDisableAutoClose("DoorOpenSlamming", true);
PlaySoundAtEntity("SlammingSound", "joint_door_move_special.snt", "DoorOpenSlamming", false);
Addtimer("", 2, "TimerStopSound");
AddTimer("DoorOpenSlamming", 0, "TimerMoveDoor");
}
void TimerMoveDoor(string &in asTimer)
{
if(GetLocalVarInt("VarDoor") == 10) return;
AddLocalVarInt("VarDoor", 1);
AddTimer(asTimer, 0.03, "TimerMoveDoor");
AddPropForce(asTimer, -70, 0, 0, "world");
}
void TimerStopSound(string &in asTimer)
{
StopSound("SlammingSound", 0.4);
}
I think im closer but im lost again
Yes exactly that!
DoorOpenSlamming>DoorB ..........................................Doorlocked>DoorA
----------------------------------------------------------------------------00000--
0
0
0
---------------------------------------------------------------------------00000--
.................................................................................................Door:Where you enter the room
(This post was last modified: 12-24-2014, 02:05 PM by Headless.)
|