Why my houses dont load when it says loaded?
#1

I wanted to get the houses loaded the console says they are loaded and if they are... Where are the icons? Anyone sees a problem in here?
pawn Код:
LoadHouses()
{
    new ExtX[11], ExtY[11], ExtZ[11];
    print("Houses are being loaded");
    mysql_query("SELECT NULL FROM Houses");
    mysql_store_result();
    new rows = mysql_num_rows();
    mysql_free_result();
   
    CheckMySQL();
   
    for(new i; i < rows; i++)
    {
        new string[128];
        format(string, sizeof(string), "SELECT * FROM Houses WHERE HouseID = '%d'", i);
        mysql_query(string);
        mysql_store_result();
       
        new row[128];
        new field[11][24];
        mysql_fetch_row_format(row, "|");
        explode(row, field, "|");
        mysql_free_result();
        mysql_fetch_field_row(AHouseData[i][ID], "HouseID");
        mysql_fetch_field_row(AHouseData[i][price], "Houseprice");
        mysql_fetch_field_row(AHouseData[i][Owner], "Houseowner");
        mysql_fetch_field_row(ExtX, "X");
        mysql_fetch_field_row(ExtY, "Y");
        mysql_fetch_field_row(ExtZ, "Z");
        AHouseData[i][HouseX] = floatstr(ExtX);
        AHouseData[i][HouseY] = floatstr(ExtY);
        AHouseData[i][HouseZ] = floatstr(ExtZ);
        if(strlen(AHouseData[i][Owner]) > 0) CreatePickup(1273, 1, AHouseData[i][HouseX], AHouseData[i][HouseY], AHouseData[i][HouseZ], -1);
        else CreatePickup(1272, 1, AHouseData[i][HouseX], AHouseData[i][HouseY], AHouseData[i][HouseZ], -1);
        printf("House %d created", i);
    }
    print("Loading finished");
}
Reply
#2

Well, I don't see here any code that's related to the icons. Do you mean pickups?
Reply
#3

Yes the pickups
Edit the logs:
[18:08:58] [MySQL] Connection to the MySQL Database was successfully!
[18:08:58] Houses are being loaded
[18:08:58] House 0 created
[18:08:58] House 1 created
[18:08:58] House 2 created
[18:08:58] House 3 created
[18:08:58] House 4 created
[18:08:58] House 5 created
[18:08:58] House 6 created
[18:08:58] House 7 created
[18:08:58] House 8 created
[18:08:58] Loading finished
So it should load but it didnt!
Reply
#4

Print the data stored in "AHouseData[i][HouseX]", "AHouseData[i][HouseY]" and " AHouseData[i][HouseZ]" to see what they store. If they are "0.0, 0.0, 0.0" you will find the pickups under the ground in Blueberry.
Reply
#5

Ok it actually IS at 0 0 0 SO how to fix it ?? :O
Reply
#6

Quote:
Originally Posted by thimo
Посмотреть сообщение
Ok it actually IS at 0 0 0 SO how to fix it ?? :O
Check the data in the database, is that correct? Are you querying the correct tables/columns?
Reply
#7

Yes i checked everything... No syntax errors.

Edit:Fixed it with Strval now!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)