14.02.2011, 22:51
All of these are returning 0..
I really need this fixed.
my "new query[715]" is at the top of the Script..
Here is the Mysql_Log.txt file;
I really need this fixed.
my "new query[715]" is at the top of the Script..
pawn Код:
forward LoadHouse();
public LoadHouse()
{
//new query[256]
new line[256], str1[128];
for(houses = 1; houses <= MAX_HOUSES; houses++)
{//Over here the variable houses is the current house's ID. That's because the current house should be the last house anyway.
printf("DEBUG: LoadHouse(); %d .0", houses);
format(query, sizeof(query), "SELECT * FROM `houses` WHERE `ID` = %i", houses);
print(query);
mysql_query(query);
mysql_store_result();
printf("DEBUG: LoadHouse(); %d .1", houses);
if(mysql_num_rows() == -1 || mysql_num_rows() == 0)
{
houses -= 1;
printf("House loop ended prematurely at %d so we have %d houses", houses +1, houses);
mysql_free_result();
return 1;
}
printf("DEBUG: LoadHouse(); %d .2", houses);
mysql_fetch_row(line);
mysql_free_result();
new temp;//placeholder
new Float:Pos[6], Inty[2];
sscanf(line, "dffffffdds", temp, Pos[0], Pos[1], Pos[2], Pos[3], Pos[4], Pos[5], Inty[0], Inty[1], HouseInfo[houses][hOwner]);
HouseInfo[houses][hEnterX] = Pos[0];
HouseInfo[houses][hEnterY] = Pos[1];
HouseInfo[houses][hEnterZ] = Pos[2];
HouseInfo[houses][hExitX] = Pos[3];
HouseInfo[houses][hExitY] = Pos[4];
HouseInfo[houses][hExitZ] = Pos[5];
HouseInfo[houses][hInt] = Inty[0];
HouseInfo[houses][hOwner] = bool:Inty[1];
if(!HouseInfo[houses][hOwned])
{
printf("%d",CreatePickup(1273, 1, HouseInfo[houses][hEnterX], HouseInfo[houses][hEnterY], HouseInfo[houses][hEnterZ], 0));
}
else
{
printf("%d",CreatePickup(1239, 1, HouseInfo[houses][hEnterX], HouseInfo[houses][hEnterY], HouseInfo[houses][hEnterZ], 0));
}
printf("DEBUG: LoadHouse(); %d .3", houses);
format(str1, sizeof(str1), "%f, %f, %f", Pos[0], Pos[1], Pos[2]);
SendClientMessageToAll(COLOR_YELLOW, str1);
}
return 1;
}
Код:
[23:09:44] Houses: ID:3. [23:09:44] Houses: EntX:0.000000. [23:09:44] Houses: EntY:0.000000. [23:09:44] Houses: EntZ:0.000000. [23:09:44] Houses: ExtX:0.000000. [23:09:44] Houses: ExtY:0.000000. [23:09:44] Houses: ExtZ:0.000000. [23:09:44] Houses: Interior:0. [23:09:44] Houses: Owned:0. [23:09:44] Houses: Owner:.