03.12.2011, 13:54
As title says:
Variable is called there.
Loading Houses OnGameModeInit:
Any ideas as to why? I've checked printf.
Variable is called there.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new string[256];
for(new x = 0; x < MAX_HOUSES; x++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseEntX[x], HouseEntY[x], HouseEntZ[x]))
{
if(pickupid == HousePickup[x])
{
if(ForSale[x] == 0)
{
printf("For Sale Value: %i", ForSale[x]);
OwnedString[x] = format(string, sizeof(string), "~g~Address:~w~ %s ~n~ ~g~Owner:~w~ %s", HouseName[x], HouseOwner[x]);
}
else if(ForSale[x] == 1)
{
UnOwnedString[x] = format(string, sizeof(string), "~r~For Sale : %s~n~~w~Price: $%d~n~~b~Type '/buyhouse' to purchase.", HouseName[x], HousePrice[x]);
}
GameTextForPlayer(playerid, string, 3000, 5);
break;
}
}
pawn Код:
stock LoadHouses()
{
new QueryString[128];
mysql_query( "SELECT id, HouseName, HouseOwner, HouseEntX, HouseEntY, HouseEntZ, HouseIntX, HouseIntY, HouseIntZ, HouseInt, HouseWS1, HouseWA1, HouseWS2, HouseWA2, HouseWS3, HouseWA3, HouseMoney, HouseCS, HousePrice, HouseLock FROM houses");
mysql_store_result();
new x = 1;
while(mysql_retrieve_row())
{
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( "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( "HouseCS", QueryString);
HouseCS[x] = strval( 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] = CreatePickup(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++;
}
mysql_free_result();
return 1;
}