okay i have a map script. in the script i have a function which makes the player being pushed (AddPlayerBodyForce). but each time i try to remove the timer of the function it does not seem to work. the player still gets pushed :/ i have tried many things and hopefully you can help
The scripting:
void OnStart()
{
SetMapDisplayNameEntry("Intro");
//User properties
SetPlayerActive(false);
SetSanityDrainDisabled(true);
SetInventoryDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerJumpDisabled(true);
ShowPlayerCrossHairIcons(false);
SetPlayerLampOil(0.0f);
//Sound properties
PlayMusic("music/intro_bg.ogg", true, 0.5, 2, 0, true);
//Timers
AddTimer("Intro", 8, "Intro");
//Finally start
//Finally Start
FadeOut(0);
FadeIn(4);
StartPlayerLookAt("prodlook", 2.0f, 2.0f, "");
AddTimer("Debug", 1, "Debug");
}
void Debug(string &in asTimer)
{
AddLocalVarInt("aq", 1);
AddDebugMessage(" "+ GetLocalVarInt("aq"), false);
AddTimer("Debug", 1, "Debug");
}
void Intro(string &in asTimer)
{
AddLocalVarInt("IntroInt", 1);
switch( GetLocalVarInt("IntroInt") )
{
case 1:
FadeOut(2);
break;
case 4:
FadeIn(4);
TeleportPlayer("PlayerStartArea_2");
StartPlayerLookAt("titellook", 2.0f, 2.0f, "");
break;
case 12:
FadeOut(3);
break;
case 14:
FadeIn(4);
TeleportPlayer("PlayerStartArea_3");
AddTimer("PushPlayerStart1", 0.01, "PushPlayer1");
StartPlayerLookAt("halllook", 2.0f, 2.0f, "");
break;
case 15:
SetMessage("Messages", "Popup1", 5);
break;
case 22:
SetMessage("Messages", "Popup2", 5);
break;
case 29:
SetMessage("Messages", "Popup3", 5);
break;
case 36:
SetMessage("Messages", "Popup4", 5);
break;
case 43:
SetMessage("Messages", "Popup5", 5);
break;
case 50:
SetMessage("Messages", "Popup6", 5);
break;
case 57:
SetMessage("Messages", "Popup7", 5);
break;
case 62:
FadeOut(3);
break;
case 64:
SetMessage("Messages", "Popup8", 5);
break;
case 69:
FadeIn(4);
TeleportPlayer("PlayerStartArea_4");
SetPlayerActive(true);
SetInventoryDisabled(false);
SetPlayerCrouchDisabled(false);
SetPlayerJumpDisabled(false);
ShowPlayerCrossHairIcons(true);
StopPlayerLookAt();
StopMusic(3.0f , 0.0f);
RemoveTimer("PushPlayerLoop1");
break;
}
if( GetLocalVarInt("IntroInt") < 126)
AddTimer("blackout", 1, "Intro");
}
void PushPlayer1(string &in asTimer)
{
AddPlayerBodyForce(0, 0.0f, 435.1f, true);
AddTimer("PushPlayerLoop1", 0.012, "PushPlayer1");
}