15.03.2011, 01:22
you can try
idk if it works i dont know MySQL
pawn Код:
stock LoadHouses(playerid)
{
new row[512];
mysql_query("SELECT * FROM `Houses`");
mysql_query(row);
mysql_store_result();
if(!mysql_num_rows())
{
return 0;
}
else
{
while(mysql_fetch_row(row, "|"))
{
sscanf(row, "p<|>s[24]s[128]dffffffdd", HouseData[playerid][HouseOwner], HouseData[playerid][HouseName], HouseData[playerid][HousePrice], HouseData[playerid][EnterX], HouseData[playerid][EnterY], HouseData[playerid][EnterZ], HouseData[playerid][ExitX], HouseData[playerid][ExitY], HouseData[playerid][ExitZ], HouseData[playerid][Interior], HouseData[playerid][Virtual]);
CreateHouse(HouseData[playerid][HouseOwner], HouseData[playerid][HouseName], HouseData[playerid][HousePrice], HouseData[playerid][EnterX], HouseData[playerid][EnterY], HouseData[playerid][EnterZ], HouseData[playerid][ExitX], HouseData[playerid][ExitY], HouseData[playerid][ExitZ], HouseData[playerid][Interior], HouseData[playerid][Virtual]);
}
mysql_free_result();
}
return 1;
}