The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing a Timer
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#1
Removing a Timer

I have a problem regarding the removal of a timer. I have a code (shown below) that opens a door, but even if I have a RemoveTimer(); script at the end of the code, the timer STILL keeps going. How do I make the timer stop?

Quote:void DoorTickTimer(string &in asTimer)
{
if(asTimer == "Ticking"){
if(GetLocalVarInt("DoorPush") < 10){
SetSwingDoorDisableAutoClose("mansion_8", true);
SetSwingDoorClosed("mansion_8", false, true);
AddLocalVarInt("DoorPush", 1);
AddPropImpulse("mansion_8", 0.2f, 0.0f, 0.0f, "");
AddTimer("Ticking", 0.1f, "DoorTickTimer");
}
}

if(GetLocalVarInt("DoorPush") == 10){
AddDebugMessage("10 Pushes!", true);
AddTimer("FreezeDoor", 1.0f, "DoorTickTimer");
}

if(asTimer == "FreezeDoor"){
SetPropStaticPhysics("mansion_8", true);
AddDebugMessage("Froze door!", true);
RemoveTimer("DoorTickTimer");
}
}

Creator of The Dark Treasure.
(This post was last modified: 01-12-2012, 01:09 PM by Linus Ågren.)
11-14-2011, 08:33 AM
Website Find


Messages In This Thread
Removing a Timer - by Linus Ågren - 11-14-2011, 08:33 AM
RE: Removing a Timer - by Tanshaydar - 11-14-2011, 06:28 PM
RE: Removing a Timer - by Your Computer - 11-14-2011, 06:50 PM
RE: Removing a Timer - by Linus Ågren - 11-15-2011, 03:08 PM
RE: Removing a Timer - by Tanshaydar - 11-15-2011, 04:04 PM



Users browsing this thread: 1 Guest(s)