[Include] Single-Player Info Boxes
#21

Quote:
Originally Posted by Gammix
Посмотреть сообщение
"Just after the timer ends", meaningful ?
Quote:
Originally Posted by Gammix
Посмотреть сообщение
"Just after the timer ends", meaningful ?
What don't you understand by "Timer IDs are never used twice.".

Timers don't re-use IDs, these increment consecutively. Timer IDs also start at 1; therefore, there is NO need to initialize variables or even reset them.

I'll use your example to explain this to you:

Let's say we use your function:

pawn Код:
ShowInfoBox(..);
HideInfoBox's ID is 1.

Now the timer ID stored is 1. Just after the timer ends, we execute a custom timer:

pawn Код:
SetTimer("very_important_timer", ...);
very_important_timer's ID is 2.

Its id is 1 as well, but just after execution, we use your function again (note the custom timer is still alive):

Its ID is 2!

pawn Код:
ShowInfoBox(..);
Kills timer ID 1.
HideInfoBox's ID is 3.

Your include kills "very_important_timer" timer, because as i previously mentioned, you don't have a check, or you don't reset the variable to "0" when the timers are no more running.

No it doesn't!
Reply


Messages In This Thread
Single-Player Info Boxes - by Kevln - 29.10.2015, 05:00
Re: Single-Player Info Boxes - by N0FeaR - 29.10.2015, 05:27
Re: Single-Player Info Boxes - by DemME - 29.10.2015, 05:32
Re: Single-Player Info Boxes - by Alex Magaсa - 29.10.2015, 05:40
Re: Single-Player Info Boxes - by N0FeaR - 29.10.2015, 05:56
Re: Single-Player Info Boxes - by DemME - 29.10.2015, 05:58
Re: Single-Player Info Boxes - by Gammix - 29.10.2015, 06:12
Re: Single-Player Info Boxes - by DemME - 29.10.2015, 06:14
Re: Single-Player Info Boxes - by Gammix - 29.10.2015, 06:20
Re: Single-Player Info Boxes - by DemME - 29.10.2015, 06:22
Re: Single-Player Info Boxes - by N0FeaR - 29.10.2015, 06:22
Re: Single-Player Info Boxes - by Kevln - 29.10.2015, 13:18
Re: Single-Player Info Boxes - by Gammix - 29.10.2015, 13:24
Re: Single-Player Info Boxes - by ATGOggy - 29.10.2015, 13:25
Re: Single-Player Info Boxes - by Kevln - 29.10.2015, 13:57
Re: Single-Player Info Boxes - by DemME - 29.10.2015, 14:13
Re: Single-Player Info Boxes - by Kevln - 29.10.2015, 14:47
Re: Single-Player Info Boxes - by Gammix - 30.10.2015, 02:14
Re: Single-Player Info Boxes - by Kevln - 30.10.2015, 02:18
Re: Single-Player Info Boxes - by Gammix - 30.10.2015, 02:23
Re: Single-Player Info Boxes - by Kevln - 30.10.2015, 03:13

Forum Jump:


Users browsing this thread: 2 Guest(s)