SQL Login problem
#1

This is very odd, another error which seemingly happened out of nowhere. Where do I begin...

In my mysql_login,
pawn Код:
stock MySQL_Login(playerid)
{
    new query[300], savingstring[20];
    format(query, sizeof(query), "SELECT * FROM playerdata WHERE user = '%s'", PlayerName(playerid));
    mysql_query(query);
    mysql_store_result();
    new angle[9];
    new model[9];
    new xcoords[9];
    new ycoords[9];
    new zcoords[9];
    new color1[9];
    new color2[9];
    new vehstring[64];
    new engine, lights, alarm, doors, bonnet, boot, objective;
    while(mysql_fetch_row_format(query, "|"))
    {
        mysql_fetch_field_row(savingstring, "score"); SetPlayerScore(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "money"); MoneyGiven[playerid] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "bankcash"); bankcash[playerid] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "robskill"); robskill[playerid] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "coprank"); coprank[playerid] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "adminlevel"); adminlevel[playerid] = strval(savingstring);
        for(new i; i < 9; i++)
        {
            vehstring = "";
            format(vehstring, sizeof(vehstring), "vehicle%ix", i+1);
            mysql_fetch_field_row(savingstring, vehstring);
            xcoords[i] = strval(savingstring);
           
            vehstring = "";
            format(vehstring, sizeof(vehstring), "vehicle%iy", i+1);
            mysql_fetch_field_row(savingstring, vehstring);
            ycoords[i] = strval(savingstring);

            vehstring = "";
            format(vehstring, sizeof(vehstring), "vehicle%iz", i+1);
            mysql_fetch_field_row(savingstring, vehstring);
            zcoords[i] = strval(savingstring);
           
            vehstring = "";
            format(vehstring, sizeof(vehstring), "angle%i", i+1);
            mysql_fetch_field_row(savingstring, vehstring);
            angle[i] = strval(savingstring);

            vehstring = "";
            format(vehstring, sizeof(vehstring), "model%i", i+1);
            mysql_fetch_field_row(savingstring, vehstring);
            model[i] = strval(savingstring);
           
            vehstring = "";
            format(vehstring, sizeof(vehstring), "%icolor1", i+1);
            mysql_fetch_field_row(savingstring, vehstring);
            color1[i] = strval(savingstring);
           
            vehstring = "";
            format(vehstring, sizeof(vehstring), "%icolor2", i+1);
            mysql_fetch_field_row(savingstring, vehstring);
            color2[i] = strval(savingstring);

            if(model[i] != 0)
            {
                new namestring[255];
                PlayerVehicles[playerid][i] = CreateVehicle(model[i], xcoords[i], ycoords[i], zcoords[i], angle[i], color1[i], color2[i], -1);
                format(namestring, 100, "%s's %s", PlayerName(playerid), VehicleNames[GetVehicleModel(PlayerVehicles[playerid][i])-400]);
                vehicle3Dtext[PlayerVehicles[playerid][i]] = Create3DTextLabel(namestring, 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
                Attach3DTextLabelToVehicle(vehicle3Dtext[PlayerVehicles[playerid][i]], PlayerVehicles[playerid][i], 0.0, 0.0, 1.0);
                GetVehicleParamsEx(PlayerVehicles[playerid][i], engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(PlayerVehicles[playerid][i], 0, lights, alarm, doors, bonnet, boot, objective);
            }
        }

    }
    mysql_free_result();
    printf("lolololol");
    SendClientMessage(playerid, -1, "You have been logged in!");
    Vehicle[playerid] = CreatePlayerTextDraw(playerid, 50.0, 250.0, "--");
    PlayerTextDrawFont(playerid, Vehicle[playerid], 3);
    PlayerTextDrawLetterSize(playerid, Vehicle[playerid], 0.399999,1.600000);
    PlayerTextDrawColor(playerid, Vehicle[playerid], 0xffffffff);

    VehicleHealth[playerid] = CreatePlayerTextDraw(playerid, 50.0, 276.0, "--");
    PlayerTextDrawLetterSize(playerid, VehicleHealth[playerid], 0.399999,1.600000);
    PlayerTextDrawFont(playerid, VehicleHealth[playerid], 3);
    PlayerTextDrawColor(playerid, VehicleHealth[playerid], 0xffffffff);
    Logged[playerid] = 1;
    return 1;
}
EDIT:
Problem came back, and I got an error tracing it back to this function. It looks like when a player has 6 vehicles it runs into problems. What can I do? I don't see any problems...
Reply


Messages In This Thread
SQL Login problem - by JackBurgani - 02.05.2013, 23:20
Re: SQL Login problem - by JackBurgani - 02.05.2013, 23:47
Re: SQL Login problem - by JackBurgani - 03.05.2013, 18:45
Re: SQL Login problem - by Vince - 03.05.2013, 19:43
Re: SQL Login problem - by JackBurgani - 03.05.2013, 21:06
Re: SQL Login problem - by JackBurgani - 04.05.2013, 13:33

Forum Jump:


Users browsing this thread: 1 Guest(s)