MySQL Floats
#1

FIXED


pawn Код:
enum dEnum
{
    ID,
    Label[128],
    Label2[128],
    X,
    Y,
    Z,
    I,
    VW,
    X2,
    Y2,
    Z2,
    I2,
    VW2,
};

new Doors[MAX_DOORS][dEnum];

//--------- the above code goes at the top of the script ---------\\
//--------- the code under this goes in OnGameModeInit  ---------\\

Doors[l][ID] = strval(field[0]);
format(Doors[l][Label], 128, "%s", field[1]);
format(Doors[l][Label2], 128, "%s", field[2]);
Doors[l][X] = strval(field[3]);
Doors[l][Y] = strval(field[4]);
Doors[l][Z] = strval(field[5]);
Doors[l][I] = strval(field[6]);
Doors[l][VW] = strval(field[7]);
Doors[l][X2] = strval(field[8]);
Doors[l][Y2] = strval(field[9]);
Doors[l][Z2] = strval(field[10]);
Doors[l][I2] = strval(field[11]);
Doors[l][VW2] = strval(field[12]);

format(string, sizeof(string), "%d, %s, %s, %f, %f, %f", Doors[l][ID], Doors[l][Label], Doors[l][Label2], Doors[l][X], Doors[l][Y], Doors[l][Z]); //debug
print(string); //debug
Console outputs Doors[l][X] to be NaN, Doors[l][Y] to 0.000000 aswell as Doors[l][Z], however it loads the ID, Label and Label2 correctly. WTF?

My login system uses floats in the same way, and it works..

Console output:

Код:
0, SFPD, Exit, NaN, 0.000000, 0.000000
The database row looks like this:

Reply


Messages In This Thread
MySQL Floats - by SKAzini - 28.02.2013, 13:37
Re: MySQL Floats - by Brokenbreaken - 28.02.2013, 13:41
Re: MySQL Floats - by Height - 28.02.2013, 13:50
Re: MySQL Floats - by SKAzini - 28.02.2013, 14:40

Forum Jump:


Users browsing this thread: 1 Guest(s)