Creating Loop but only loops to 7...
#1

Hi guys,

I've never experienced such a strange problem until now, and it's officially left me totally stumped, originally I assumed it was one of the arrays I was using that I perhaps only allocated 7 slots within the 1 dimensional array, so I decided to just printf the current loop integer, in which it finishes at 7...? This makes no sense. Here are screenshots and code to help explain it.


Called at OnGameModeInit()
pawn Код:
format(query, sizeof(query), "SELECT * FROM `bizzactors`");
    mysql_function_query(dbHandle, query, true, "LoadBizzActors", "");
pawn Код:
forward LoadBizzActors();
public LoadBizzActors()
{
    new rows,
        fields,
        temp[100];


    cache_get_data(rows, fields);


    for (new i = 0; i < rows; i++)
    {
        printf("%d", i);

        cache_get_row(i, 0, temp), BizzActors[i][ActorID] = strval(temp);

        cache_get_row(i, 1, temp), BizzActors[i][Actors][i] = strval(temp);

        BizzActors[i][ActX] = cache_get_row_float(i, 2);

        BizzActors[i][ActY] = cache_get_row_float(i, 3);

        BizzActors[i][ActZ] = cache_get_row_float(i, 4);

        BizzActors[i][ActA] = cache_get_row_float(i, 5);

        cache_get_row(i, 6, temp), BizzActors[i][ActorVirtualWorld] = strval(temp);

        cache_get_row(i, 7, temp), BizzActors[i][ActorBizzID] = strval(temp);

        BizzActorNPC[i] = CreateActor(BizzActors[i][Actors][i], BizzActors[i][ActX], BizzActors[i][ActY], BizzActors[i][ActZ], 0.0);

        SetActorFacingAngle(BizzActorNPC[i], BizzActors[i][ActA]);

        SetActorInvulnerable(BizzActorNPC[i], true);

        SetActorVirtualWorld(BizzActorNPC[i], BizzActors[i][ActorVirtualWorld]);


        //printf("BizzActorNPC[%d] %d, %f, %f, %f", i, BizzActors[i][Actors][i], BizzActors[i][ActX], BizzActors[i][ActY], BizzActors[i][ActZ]);
    }

    return 1;
}


The database evidently has more than 7 rows. This is affecting the server now as peoples 'actors' within their businesses are not spawning if they're after row 7.


Extra Info: Being tested on my local machine using XAMPP for Apache and SQL.
Reply


Messages In This Thread
Creating Loop but only loops to 7... - by LiamM - 14.09.2015, 22:48
Respuesta: Creating Loop but only loops to 7... - by Zume - 15.09.2015, 00:07
Re: Creating Loop but only loops to 7... - by Scenario - 15.09.2015, 01:17
Re: Respuesta: Creating Loop but only loops to 7... - by LiamM - 15.09.2015, 07:31

Forum Jump:


Users browsing this thread: 1 Guest(s)