Little help please?
#1

It's late, I'm tired, this could be a real noob mistake.. but I'm not seeing it atm..

pawn Код:
for(new i = 0; i < 8; i++)
{
    if(Local[0] == Fastest[i]) ID[0] = i, printf("ID[0] set to %i", i);
    if(Local[1] == Fastest[i]) ID[1] = i, printf("ID[1] set to %i", i);
    if(Local[2] == Fastest[i]) ID[2] = i, printf("ID[2] set to %i", i);
    if(Local[3] == Fastest[i]) ID[3] = i, printf("ID[3] set to %i", i);
    if(Local[4] == Fastest[i]) ID[4] = i, printf("ID[4] set to %i", i);
    if(Local[5] == Fastest[i]) ID[5] = i, printf("ID[5] set to %i", i);
    if(Local[6] == Fastest[i]) ID[6] = i, printf("ID[6] set to %i", i);
    if(Local[7] == Fastest[i]) ID[7] = i, printf("ID[7] set to %i", i);

    if(ID[i] == 0) printf("ID[%i] matched to 0", i);
    if(ID[i] == 1) printf("ID[%i] matched to 1", i);
    if(ID[i] == 2) printf("ID[%i] matched to 2", i);
    if(ID[i] == 3) printf("ID[%i] matched to 3", i);
    if(ID[i] == 4) printf("ID[%i] matched to 4", i);
    if(ID[i] == 5) printf("ID[%i] matched to 5", i);
    if(ID[i] == 6) printf("ID[%i] matched to 6", i);
    if(ID[i] == 7) printf("ID[%i] matched to 7", i);
}
and

Код:
[00:59:49] ID[4] set to 0
[00:59:49] ID[3] set to 1
[00:59:49] ID[2] set to 2
[00:59:49] ID[1] set to 3
[00:59:49] ID[0] set to 4
[00:59:49] ID[5] set to 5
[00:59:49] ID[6] set to 6
[00:59:49] ID[7] set to 7

[00:59:49] ID[0] matched to 0
[00:59:49] ID[1] matched to 0
[00:59:49] ID[2] matched to 2
[00:59:49] ID[3] matched to 1
[00:59:49] ID[4] matched to 0
[00:59:49] ID[5] matched to 5
[00:59:49] ID[6] matched to 6
[00:59:49] ID[7] matched to 7
Code should be self explanatory?
EDIT: Yes I know I didnt use "else if" - its the same output with or without
Reply
#2

pawn Код:
for(new i = 0; i < 8; i++)
{
    if(Local[i] == Fastest[i]) ID[0] = i, printf("ID[%i] set to %i >> Value: %d", i, i,Local[i]);

    // ID[i] == i - check the value is equal 'i'.
    if(ID[i] == i) printf("ID[%i] matched to %i >> Value: %d", i, i, ID[i]);
}
Reply
#3

That would stop it from working as it should

I added another debug at the very bottom of my callback
pawn Код:
printf("%i %i %i %i %i %i %i %i", ID[0], ID[1], ID[2], ID[3], ID[4], ID[5], ID[6], ID[7]);
and on the console it prints out
Код:
[17:22:24] 4 3 2 1 0 5 6 7
Which is exactly what it should do!
But still the matching fails..

pawn Код:
if(ID[i] == 0) printf("ID[%i] matched to 0", i);
if(ID[i] == 1) printf("ID[%i] matched to 1", i);
if(ID[i] == 2) printf("ID[%i] matched to 2", i);
if(ID[i] == 3) printf("ID[%i] matched to 3", i);
if(ID[i] == 4) printf("ID[%i] matched to 4", i);
if(ID[i] == 5) printf("ID[%i] matched to 5", i);
if(ID[i] == 6) printf("ID[%i] matched to 6", i);
if(ID[i] == 7) printf("ID[%i] matched to 7", i);
and console output:

Код:
[17:22:24] ID[0] matched to 0
[17:22:24] ID[1] matched to 0
[17:22:24] ID[2] matched to 2
[17:22:24] ID[3] matched to 1
[17:22:24] ID[4] matched to 0
[17:22:24] ID[5] matched to 5
[17:22:24] ID[6] matched to 6
[17:22:24] ID[7] matched to 7
EDIT: Sorry for double
EDIT 2: I put the ID check onto a seperate loop and it works fine
Reply
#4

Tell me whats comes out with this.
pawn Код:
for(new i = 0; i < 9; i++)
{
    if(Local[i] == Fastest[i]) ID[0] = i, printf("ID[%i] set to %i >> Value: %d", i, i,Local[i]);

    // ID[i] == i - check the value is equal 'i'.
    if(ID[i] == i) printf("ID[%i] matched to %i >> Value: %d", i, i, ID[i]);
    else printf("Value of i %d and ID i =%d ", i, ID[i]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)