(10-21-2012, 09:46 PM)belikov Wrote: (10-21-2012, 06:49 PM)beecake Wrote: you can always use the ""+something
I sometimes do this: AddTimer("Timer_"+RandInt(1, 3), 5, "Timer");
void Timer(string &in asTimer)
{
if(asTimer == "Timer_1")
{
}
if(asTimer == "Timer_2")
{
}
if(asTimer == "Timer_3")
{
}
}
understand?
well i got the "For" command
but this confuses me.. :/
The "Timer_"+RandInt(1, 3)" makes 3 timers with names : Timer_1,Timer_2 and Timer_3 ?
And what exactly you compare in the "If" commands?
What it does is:
There are 3 timers. You call "Timer_" and then it picks a random number from 1 to 3, which is added to the name Timer_. This results in a random timer being called
It's just another way to use ""+Something
Trying is the first step to success.