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
Timer not stopping
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Timer not stopping

PHP Code: (Select All)
void OnStart()
{
    for (
int i 014i++)
    {
        
AddEntityCollideCallback("Player""ShadowArea_"+i"ShadowDamage"true0);
    }
}

void ShadowDamage(string &in asParentstring &in asChildint alState)
{
    if (
alState == 1)
    {
        
AddTimer("damage"2.0f"TimerDamage");
    }
    else if (
alState == -1)
    {
        
RemoveTimer("damage");
    }
}

void TimerDamage(string &in asTimer)
{
    
GivePlayerDamage(20"BloodSplat"truetrue);
    
PlayGuiSound("attack_claw_hit.snt"0.5f);
    
AddTimer("damage"RandFloat(5.0f7.0f), "TimerDamage");


I'm trying to make an area that damages you ever 5-7 seconds while you're inside, but stops damaging you when you leave it. However, even after I leave the area, I keep getting damaged over and over. Am I missing something here?

01-01-2013, 04:43 PM
Find


Messages In This Thread
Timer not stopping - by Damascus - 01-01-2013, 04:43 PM
RE: Timer not stopping - by FlawlessHappiness - 01-01-2013, 04:58 PM
RE: Timer not stopping - by TheGreatCthulhu - 01-01-2013, 08:10 PM
RE: Timer not stopping - by Damascus - 01-01-2013, 08:53 PM
RE: Timer not stopping - by TheGreatCthulhu - 01-01-2013, 09:11 PM



Users browsing this thread: 1 Guest(s)