Forum

> > CS2D > Scripts > Detecting the max amount in variable each second
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Detecting the max amount in variable each second

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Detecting the max amount in variable each second

SkullFace
User Off Offline

Zitieren
Even if my problem was solved from the thread before, thread cs2d How to get player ID in variable ?, I found out that when the counter reaches the max , it doesn't execute/it ignores some lines.

Take a look :
Spoiler >

alt Re: Detecting the max amount in variable each second

Cure Pikachu
User Off Offline

Zitieren
Your code logic goes like this:
1. Counter (
redFlagCount
) starts at 0, and stays at 0 because
0 + 0 = 0

2. Counter starts incrementing by 1 (
redFlagAdd
) per second once red flag is taken, never stops even if new round begins
3. Once the counter is equal to the value of
redFlagMax
(which is 6 in this instance), execute your cs2d cmd setpos code (which does not work anyway because the cs2d lua hook second hook has no parameters) and your cs2d lua cmd msg code
4. And because you did not reset the counter, that few lines of code will never execute again until you restart the script
5× editiert, zuletzt 23.07.18 16:30:49
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht