double loop.
#1

Not work. Stops at 0, does not increase greater than 0.

HTML Code:
for(new i = 0, r = 0; i <= GetPlayerPoolSize(), r < 9; i++, r++)
Reply
#2

i don't think that is how it works ^^

how about this

sorry if i didnt understand what u tried

PHP Code:
for( new counterOuter 0counterOuter <= GetPlayerPoolSize(); counterOuter++)
{
    
//Your Code
    
for( new counterInner 0counterInner <= GetPlayerPoolSize(); counterInner++)
    {
        
//Your Code
    
}

Reply
#3

I don't get what you're trying to do.
Also, it's not recommended to use GetPlayerPoolSize like that in a loop.
The best way to use it is:
Code:
for (new i, j = GetPlayerPoolSize(); i <= j; i++)
Reply
#4

It will stop at the two conditions:
pawn Code:
i <= GetPlayerPoolSize()
If it stops on 0, that means you have no players in server.

pawn Code:
r < 9
This one is a constant one so it will stop at 8 all the time.

So your loop can reach a maximum of 8 and minimum of 0.
Reply
#5

Quote:
Originally Posted by [Bios]Marcel
View Post
i don't think that is how it works ^^

how about this

sorry if i didnt understand what u tried

PHP Code:
for( new counterOuter 0counterOuter <= GetPlayerPoolSize(); counterOuter++)
{
    
//Your Code
    
for( new counterInner 0counterInner <= GetPlayerPoolSize(); counterInner++)
    {
        
//Your Code
    
}

Ok, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)