06.04.2014, 06:52
pawn Код:
stock LoadHouses()
{
new QueryString[128];
mysql_query( "SELECT * FROM houses");
mysql_store_result();
new x;
while(mysql_retrieve_row())
{
mysql_get_field( "id", QueryString);
x = strval( QueryString);
mysql_get_field("HouseName", HouseName[x]);
mysql_get_field("HouseOwner", HouseOwner[x]);
mysql_get_field( "HouseEntX", QueryString);
HouseEntX[x] = floatstr( QueryString);
mysql_get_field( "HouseEntY", QueryString);
HouseEntY[x] = floatstr( QueryString);
mysql_get_field( "HouseEntZ", QueryString);
HouseEntZ[x] = floatstr( QueryString);
mysql_get_field( "HouseIntX", QueryString);
HouseIntX[x] = floatstr( QueryString);
mysql_get_field( "HouseIntY", QueryString);
HouseIntY[x] = floatstr( QueryString);
mysql_get_field( "HouseIntZ", QueryString);
HouseIntZ[x] = floatstr( QueryString);
mysql_get_field( "HouseInt", QueryString);
HouseInt[x] = strval( QueryString);
mysql_get_field( "HouseVW", QueryString);
HouseVW[x] = strval( QueryString);
mysql_get_field( "HouseWS1", QueryString);
HouseWS1[x] = strval( QueryString);
mysql_get_field( "HouseWA1", QueryString);
HouseWA1[x] = strval( QueryString);
mysql_get_field( "HouseWS2", QueryString);
HouseWS2[x] = strval( QueryString);
mysql_get_field( "HouseWA2", QueryString);
HouseWA2[x] = strval( QueryString);
mysql_get_field( "HouseWS3", QueryString);
HouseWS3[x] = strval( QueryString);
mysql_get_field( "HouseWA3", QueryString);
HouseWA3[x] = strval( QueryString);
mysql_get_field( "HouseMoney", QueryString);
HouseMoney[x] = strval( QueryString);
mysql_get_field( "HouseCoke", QueryString);
HouseCoke[x] = strval( QueryString);
mysql_get_field( "HouseWeed", QueryString);
HouseWeed[x] = strval( QueryString);
mysql_get_field( "HouseArmour", QueryString);
HouseArmour[x] = floatstr( QueryString);
mysql_get_field( "HousePrice", QueryString);
HousePrice[x] = strval( QueryString);
mysql_get_field( "HouseLock", QueryString);
HouseLock[x] = strval( QueryString);
mysql_get_field( "ForSale", QueryString);
ForSale[x] = strval( QueryString);
HousePickup[x] = CreateDynamicPickup(1273, 23, HouseEntX[x], HouseEntY[x], HouseEntZ[x], 0);
CreateDynamic3DTextLabel(HouseName[x], COLOUR_LIGHTBLUE, HouseEntX[x],HouseEntY[x], HouseEntZ[x], 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 50.0);
x++;
}
printf("HOUSES LOADED: %d",x);
mysql_free_result();
return 1;
}
I have made sure I can view 50 records on Php.