looping from 4 to 8?
#1

new ASD[8];
How can I loop from 4 to 8?
Like this?
for(new s = 4; s < 8; s++) Doesn't work though.
Reply
#2

Why not use a switch statement?

pawn Код:
switch(ASD)
{
    case 4..8:
    {
        // code
    }
}
Reply
#3

I want to show a textdraws.
pawn Код:
new Text:TD[8];

TD[0] = TextDrawCreate(.....);
TD[1] = TextDrawCreate(.....);
TD[2] = TextDrawCreate(.....);
TD[3] = TextDrawCreate(.....);
TD[4] = TextDrawCreate(.....);
TD[5] = TextDrawCreate(.....);
TD[6] = TextDrawCreate(.....);
TD[7] = TextDrawCreate(.....);
//I just want to show textdraw 4 to 8. So that's why I need to loop it. But I don't know how.
Reply
#4

No idea why it wouldn't work
As alternative, you can use
for(new s=0; s<4; s++)
And then use s+4
Reply
#5

You shouldn't need a loop for something that small, you could just show the 4 textdraws you want using the 'TextDrawCreate' function
Reply
#6

so, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
pawn Код:
for(new i = 4; i <= 8; i++) {
     print("Loop %d\n", i);
}
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
pawn Код:
for(new i = 4; i < 8; i++) {
     print("Loop %d\n", i);
}
What's the trouble of it?
Reply
#7

@Kikito: It shows for 1 second, then it's gone.
@PinkFloydLover: I have a lot actually.

EDIT: Fixed! It's another problem actually.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)