Forum

> > CS2D > Scripts > Detecting the max amount in variable each second
Forums overviewCS2D overview Scripts overviewLog in to reply

English Detecting the max amount in variable each second

2 replies
To the start Previous 1 Next To the start

old Detecting the max amount in variable each second

SkullFace
User Off Offline

Quote
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 >

old Re: Detecting the max amount in variable each second

Cure Pikachu
User Off Offline

Quote
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
edited 5×, last 23.07.18 04:30:49 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview