void OnStart()
{
AddUseItemCallback("", "HandDrill", "InteractDrill_1", "DrillHole1", false);
AddUseItemCallback("", "HandDrill", "InteractDrill_2", "DrillHole2", false);
AddUseItemCallback("", "HandDrill", "InteractDrill_3", "DrillHole3", false);
}
void DrillHole1(string &in asItem, string &in asEntity)
{
if(HasItem("Container_1") == true)
{
RemoveItem(asItem);
SetEntityActive("InvisibleContainer_1", true);
SetEntityActive("HandDrill_1", true);
RemoveItem("Container_1");
AddAttachedPropToProp("InvisibleContainer_1", "ContainerEmpty", "chemical_container_static.ent", 0,0,0,0,0,0);
AddTimer("interact1", 1, "StartDrillingHalf");
}
if(HasItem("Container_Half") == true)
{
RemoveItem(asItem);
SetEntityActive("InvisibleContainer_1", true);
SetEntityActive("HandDrill_1", true);
RemoveItem("Container_Half");
AddAttachedPropToProp("InvisibleContainer_1", "ContainerHalfFull", "chemical_container_half_static.ent", 0,0,0,0,0,0);
AddTimer("interact4", 1, "StartDrillingHalf");
}
else
{
SetMessage("Messages", "NotEnough", 3);
}
}
void DrillHole2(string &in asItem, string &in asEntity)
{
if(HasItem("Container_1") == true)
{
RemoveItem(asItem);
SetEntityActive("InvisibleContainer_2", true);
SetEntityActive("HandDrill_2", true);
RemoveItem("Container_1");
AddAttachedPropToProp("InvisibleContainer_2", "ContainerEmpty", "chemical_container_static.ent", 0,0,0,0,0,0);
AddTimer("interact2", 1, "StartDrillingHalf");
}
if(HasItem("Container_Half") == true)
{
RemoveItem(asItem);
SetEntityActive("InvisibleContainer_2", true);
SetEntityActive("HandDrill_2", true);
RemoveItem("Container_Half");
AddAttachedPropToProp("InvisibleContainer_2", "ContainerHalfFull", "chemical_container_half_static.ent", 0,0,0,0,0,0);
AddTimer("interact5", 1, "StartDrillingHalf");
}
else
{
SetMessage("Messages", "NotEnough", 3);
}
}
void DrillHole3(string &in asItem, string &in asEntity)
{
if(HasItem("Container_1") == true)
{
RemoveItem(asItem);
SetEntityActive("InvisibleContainer_3", true);
SetEntityActive("HandDrill_3", true);
RemoveItem("Container_1");
AddAttachedPropToProp("InvisibleContainer_3", "ContainerEmpty", "chemical_container_static.ent", 0,0,0,0,0,0);
AddTimer("interact3", 1, "StartDrillingHalf");
}
if(HasItem("Container_Half") == true)
{
RemoveItem(asItem);
SetEntityActive("InvisibleContainer_3", true);
SetEntityActive("HandDrill_3", true);
RemoveItem("Container_Half");
AddAttachedPropToProp("InvisibleContainer_3", "ContainerHalfFull", "chemical_container_half_static.ent", 0,0,0,0,0,0);
AddTimer("interact6", 1, "StartDrillingHalf");
}
else
{
SetMessage("Messages", "NotEnough", 3);
}
}
void StartDrillingHalf(string &in asTimer)
{
if(asTimer == "interact1")
{
RotatePropToSpeed("HandDrill_1", 1, 3, -180, 0, 0, false, "AreaRotate_1");
CreateParticleSystemAtEntity("drip1","ps_liquid_epoxy_drip.ps", "AreaParticleWine_1", false);
AddTimer("drilled1", 5, "GiveHalfContainer");
}
if(asTimer == "interact2")
{
RotatePropToSpeed("HandDrill_2", 1, 3, -180, 0, 0, false, "AreaRotate_2");
CreateParticleSystemAtEntity("drip2","ps_liquid_epoxy_drip.ps", "AreaParticleWine_2", false);
AddTimer("drilled2", 5, "GiveHalfContainer");
}
if(asTimer == "interact3")
{
RotatePropToSpeed("HandDrill_3", 1, 3, -180, 0, 0, false, "AreaRotate_3");
CreateParticleSystemAtEntity("drip3","ps_liquid_epoxy_drip.ps", "AreaParticleWine_3", false);
AddTimer("drilled3", 5, "GiveHalfContainer");
}
if(asTimer == "interact4")
{
RotatePropToSpeed("HandDrill_1", 1, 3, -180, 0, 0, false, "AreaRotate_1");
CreateParticleSystemAtEntity("drip4","ps_liquid_epoxy_drip.ps", "AreaParticleWine_1", false);
AddTimer("drilled4", 5, "GiveFullContainer");
}
if(asTimer == "interact5")
{
RotatePropToSpeed("HandDrill_2", 1, 3, -180, 0, 0, false, "AreaRotate_2");
CreateParticleSystemAtEntity("drip5","ps_liquid_epoxy_drip.ps", "AreaParticleWine_2", false);
AddTimer("drilled5", 5, "GiveFullContainer");
}
if(asTimer == "interact6")
{
RotatePropToSpeed("HandDrill_3", 1, 3, -180, 0, 0, false, "AreaRotate_3");
CreateParticleSystemAtEntity("drip6","ps_liquid_epoxy_drip.ps", "AreaParticleWine_3", false);
AddTimer("drilled6", 5, "GiveFullContainer");
}
}
void GiveHalfContainer(string &in asTimer)
{
if(asTimer == "drilled1")
{
DestroyParticleSystem("drip1");
RotatePropToSpeed("HandDrill_1", 0, 0, 0, 0, 0, false, "AreaRotate_1");
RemoveAttachedPropFromProp("InvisibleContainer_1", "ContainerEmpty");
AddAttachedPropToProp("InvisibleContainer_1", "ContainerHalf", "chemical_container_half_static.ent", 0,0,0,0,0,0);
SetEntityCustomFocusCrossHair("InvisibleContainer_1","Pick");
SetEntityPlayerInteractCallback("InvisibleContainer_1", "PickUpHalfContainer", true);
SetEntityActive("PickDrill_1", true);
}
if(asTimer == "drilled2")
{
DestroyParticleSystem("drip2");
RotatePropToSpeed("HandDrill_2", 0, 0, 0, 0, 0, false, "AreaRotate_2");
RemoveAttachedPropFromProp("InvisibleContainer_2", "ContainerEmpty");
AddAttachedPropToProp("InvisibleContainer_2", "ContainerHalf", "chemical_container_half_static.ent", 0,0,0,0,0,0);
SetEntityCustomFocusCrossHair("InvisibleContainer_2","Pick");
SetEntityPlayerInteractCallback("InvisibleContainer_2", "PickUpHalfContainer2", true);
SetEntityActive("PickDrill_2", true);
}
if(asTimer == "drilled3")
{
DestroyParticleSystem("drip3");
RotatePropToSpeed("HandDrill_3", 0, 0, 0, 0, 0, false, "AreaRotate_3");
RemoveAttachedPropFromProp("InvisibleContainer_3", "ContainerEmpty");
AddAttachedPropToProp("InvisibleContainer_3", "ContainerHalf", "chemical_container_half_static.ent", 0,0,0,0,0,0);
SetEntityCustomFocusCrossHair("InvisibleContainer_3","Pick");
SetEntityPlayerInteractCallback("InvisibleContainer_3", "PickUpHalfContainer3", true);
SetEntityActive("PickDrill_3", true);
}
}
void GiveFullContainer(string &in asTimer)
{
if(asTimer == "drilled4")
{
DestroyParticleSystem("drip4");
RotatePropToSpeed("HandDrill_1", 0, 0, 0, 0, 0, false, "AreaRotate_1");
RemoveAttachedPropFromProp("InvisibleContainer_1", "ContainerHalfFull");
AddAttachedPropToProp("InvisibleContainer_1", "ContainerFull", "chemical_container_epoxy_static.ent", 0,0,0,0,0,0);
SetEntityCustomFocusCrossHair("InvisibleContainer_1","Pick");
SetEntityPlayerInteractCallback("InvisibleContainer_1", "PickUpFullContainer", true);
}
if(asTimer == "drilled5")
{
DestroyParticleSystem("drip5");
RotatePropToSpeed("HandDrill_2", 0, 0, 0, 0, 0, false, "AreaRotate_2");
RemoveAttachedPropFromProp("InvisibleContainer_2", "ContainerHalfFull");
AddAttachedPropToProp("InvisibleContainer_2", "ContainerFull", "chemical_container_epoxy_static.ent", 0,0,0,0,0,0);
SetEntityCustomFocusCrossHair("InvisibleContainer_2","Pick");
SetEntityPlayerInteractCallback("InvisibleContainer_2", "PickUpFullContainer2", true);
}
if(asTimer == "drilled6")
{
DestroyParticleSystem("drip6");
RotatePropToSpeed("HandDrill_3", 0, 0, 0, 0, 0, false, "AreaRotate_3");
RemoveAttachedPropFromProp("InvisibleContainer_3", "ContainerHalfFull");
AddAttachedPropToProp("InvisibleContainer_3", "ContainerFull", "chemical_container_epoxy_static.ent", 0,0,0,0,0,0);
SetEntityCustomFocusCrossHair("InvisibleContainer_3","Pick");
SetEntityPlayerInteractCallback("InvisibleContainer_3", "PickUpFullContainer3", true);
}
}
void PickUpHalfContainer(string &in asEntity)
{
RemoveAttachedPropFromProp("InvisibleContainer_1", "ContainerHalf");
SetEntityActive("InvisibleContainer_1", false);
GiveItem("ContainerHalf_Item", "Puzzle", "ContainerHalf", "chemical_container_epoxy.tga", 1);
SetEntityCustomFocusCrossHair("HandDrill_1","Pick");
SetEntityPlayerInteractCallback("HandDrill_1", "PickUpDrill", true);
}
void PickUpHalfContainer2(string &in asEntity)
{
RemoveAttachedPropFromProp("InvisibleContainer_2", "ContainerHalf");
SetEntityActive("InvisibleContainer_2", false);
GiveItem("ContainerHalf_Item", "Puzzle", "ContainerHalf", "chemical_container_epoxy.tga", 1);
SetEntityCustomFocusCrossHair("HandDrill_2","Pick");
SetEntityPlayerInteractCallback("HandDrill_2", "PickUpDrill", true);
}
void PickUpHalfContainer3(string &in asEntity)
{
RemoveAttachedPropFromProp("InvisibleContainer_3", "ContainerHalf");
SetEntityActive("InvisibleContainer_3", false);
GiveItem("ContainerHalf_Item", "Puzzle", "ContainerHalf", "chemical_container_epoxy.tga", 1);
SetEntityCustomFocusCrossHair("HandDrill_3","Pick");
SetEntityPlayerInteractCallback("HandDrill_3", "PickUpDrill", true);
}
void PickUpFullContainer(string &in asEntity)
{
RemoveAttachedPropFromProp("InvisibleContainer_1", "ContainerFull");
SetEntityActive("InvisibleContainer_1", false);
GiveItem("ContainerFull_Item", "Puzzle", "ContainerFull", "chemical_container_epoxy.tga", 1);
SetEntityActive("InteractDrill_1", false);
SetEntityActive("InteractDrill_2", false);
SetEntityActive("InteractDrill_3", false);
}
void PickUpFullContainer2(string &in asEntity)
{
RemoveAttachedPropFromProp("InvisibleContainer_2", "ContainerFull");
SetEntityActive("InvisibleContainer_2", false);
GiveItem("ContainerFull_Item", "Puzzle", "ContainerFull", "chemical_container_epoxy.tga", 1);
SetEntityActive("InteractDrill_1", false);
SetEntityActive("InteractDrill_2", false);
SetEntityActive("InteractDrill_3", false);
}
void PickUpFullContainer3(string &in asEntity)
{
RemoveAttachedPropFromProp("InvisibleContainer_3", "ContainerFull");
SetEntityActive("InvisibleContainer_3", false);
GiveItem("ContainerFull_Item", "Puzzle", "ContainerFull", "chemical_container_epoxy.tga", 1);
SetEntityActive("InteractDrill_1", false);
SetEntityActive("InteractDrill_2", false);
SetEntityActive("InteractDrill_3", false);
}
void GetDrill(string &in asEntity)
{
GiveItem("HandDrill", "Puzzle", "DrillFinal", "hand_drill.tga", 1);
SetEntityActive(asEntity, false);
if(asEntity == "PickDrill_1")
{
SetEntityActive("HandDrill_1", false);
}
if(asEntity == "PickDrill_2")
{
SetEntityActive("HandDrill_2", false);
}
if(asEntity == "PickDrill_3")
{
SetEntityActive("HandDrill_3", false);
}
}