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
[SOLVED] RemoveTimer doesn't work
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#9
RE: RemoveTimer doesn't work

void girl_flee_stop_timer(string &in asTimer)
{
PlaySoundAtEntity("", "door_level_wood_open", "level_wood_1", 0, false);
SetGlobalVarInt("Cellar", 1);
RemoveTimer("girl_cry");
StopSound("12_girl_cry", 0);
}

///TIMERS

void cry_1_timer(string &in asTimer)
{
PlaySoundAtEntity("", "12_girl_cry", "mansion_5", 0.5f, false);
AddTimer("girl_cry", 40, "cry_1_timer");
}
(05-20-2012, 07:29 PM)Putmalk Wrote: Okay, I see it.



StopSound isn't stopping the correct sound. That's because you left your sound name blank (a practice I HIGHLY do not recommend, because then problems like this are so easy to happen).



Rewrite your sound function like this:

PlaySoundAtEntity("girlcry", "12_girl_cry", "mansion_5", 0.5f, false);





Then, StopSound("girlcry", 0); will work.



And start naming your sounds and callbacks. That will make problems like this easier to avoid as well as make your scripts easier to understand. Just name them simply so you can understand them. Just note that only certain functions support names, like PlaySound..., CreateParticleSystem..., AddUseItemCallback, AddTimer, etc.



Hope this helps!
Why don't you read your advice boy?

PlaySoundAtEntity("girlcry", "12_girl_cry", "mansion_5", 0.5f, false);

Naming goes here ^

[Image: mZiYnxe.png]


05-24-2012, 10:32 AM
Find


Messages In This Thread
RE: RemoveTimer doesn't work - by Putmalk - 05-20-2012, 07:29 PM
RE: RemoveTimer doesn't work - by Statyk - 05-20-2012, 07:36 PM
RE: RemoveTimer doesn't work - by Cranky Old Man - 05-20-2012, 07:54 PM
RE: RemoveTimer doesn't work - by Statyk - 05-20-2012, 07:59 PM
RE: RemoveTimer doesn't work - by Cranky Old Man - 05-24-2012, 12:49 PM
RE: RemoveTimer doesn't work - by Your Computer - 05-24-2012, 10:32 AM
RE: RemoveTimer doesn't work - by Acies - 05-24-2012, 10:32 AM



Users browsing this thread: 2 Guest(s)