05-11-2015, 07:01 PM
I have this casetimer that will start running by an addtimer from a function which looks something like this
The problem is as I said, the case timer doesnt work when entering this level from another level from a lever door.
it only starts working when loading this level from start or by the debug menu. Again, the lockdoor function works when colliding with an area but the case timer doesn't want to, doesnt function when entering this level from another level
Any ideas pls? I have no idea what the hell is causing this and never happened to me before
Nevermind guys, it has been fixed by DnAlange!
It was such an easy fix lol yet so frustrating xD
PHP Code:
void lockdoor(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(0.01f, 0.5f, 0.5f, 1.0f);
SetEntityActive("lockdoor", false);
PlayGuiSound("scare_slam_door.snt", 0.7f);
AddPropForce("cellar_wood01_4", 0, 0, -50000, "world");
AddTimer("", 0.4, "lockit");
}
void lockit(string &in asTimer)
{
float fEventSpeed=0;
AddLocalVarInt("TimerEvent", 1);
switch(GetLocalVarInt("TimerEvent"))
{
case 1:
SetSwingDoorLocked("cellar_wood01_4", true, false);
PlayGuiSound("lock_door", 1.6);
SetEntityActive("male_arm_1", false);
fEventSpeed = 3.0f;
break;
case 2:
PlayGuiSound("amb_hunt04.ogg", 1.6);
PlayMusic("att_grunt", true, 1, 5, 1, true);
SetPlayerRunSpeedMul(0.5f);
SetPlayerMoveSpeedMul(0.5f);
fEventSpeed = 2.0f;
break;
case 3:
StartScreenShake(0.1f, 0.5f, 0.1f,0.3f);
AddPropImpulse("cellar_wood01_4", 0, 0, -10, "World");
PlaySoundAtEntity("", "21_bang_door", "cellar_wood01_4", 0.25f, false);
CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "cellar_wood01_4", false);
fEventSpeed = 3.0f;
break;
case 4:
StartScreenShake(0.1f, 0.5f, 0.1f,0.3f);
AddPropImpulse("cellar_wood01_4", 0, 0, -10, "World");
PlaySoundAtEntity("", "21_bang_door", "cellar_wood01_4", 0.25f, false);
CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "cellar_wood01_4", false);
fEventSpeed = 0.6f;
break;
case 5:
AddEffectVoice("voices", "Ch01L09.ogg", "Voice", "HolyGesus",
false, "EventDoor", 1, 1);
SetEntityActive("corpse_male_arm_1", true);
StartPlayerLookAt("corpse_male_arm_1", 10, 4, "");
fEventSpeed = 1.0f;
break;
case 6:
AddEffectVoice("voices", "Ch01L08.ogg", "Voice", "HolyGesus",
false, "EventDoor", 1, 1);
StopPlayerLookAt();
fEventSpeed = 2.0f;
break;
case 7:
PlayGuiSound("react_breath", 0.7f);
fEventSpeed = 2.0f;
break;
}
if(GetLocalVarInt("TimerEvent") <7) AddTimer("TimerEvent",fEventSpeed, "lockit");
}
The problem is as I said, the case timer doesnt work when entering this level from another level from a lever door.
it only starts working when loading this level from start or by the debug menu. Again, the lockdoor function works when colliding with an area but the case timer doesn't want to, doesnt function when entering this level from another level
Any ideas pls? I have no idea what the hell is causing this and never happened to me before
Nevermind guys, it has been fixed by DnAlange!
It was such an easy fix lol yet so frustrating xD