Houses does not load.
#1

Code:
public LoadHouses()
{
	new str[250];
	new query[1000];
	new rows = cache_get_row_count(dbhandle);
	for(new i = 0; i < rows && i < MAX_HOUSES; i ++)
	{
		DestroyPickup(HouseInfo[i][hPickup]);
		DestroyDynamic3DTextLabel(HouseInfo[i][hLabel]);
		cache_get_field_content(i, "Owner", HouseInfo[i][hOwner], dbhandle, MAX_PLAYER_NAME);
		HouseInfo[i][hID] 		      = cache_get_field_content_int(i, "ID", dbhandle);
		HouseInfo[i][hOutPos][0]      = cache_get_field_content_float(i, "Out_X", dbhandle);
		HouseInfo[i][hOutPos][1]      = cache_get_field_content_float(i, "Out_Y", dbhandle);
		HouseInfo[i][hOutPos][2]      = cache_get_field_content_float(i, "Out_Z", dbhandle);
		HouseInfo[i][hIntPos][0]      = cache_get_field_content_float(i, "Int_X", dbhandle);
		HouseInfo[i][hIntPos][1]      = cache_get_field_content_float(i, "Int_Y", dbhandle);
		HouseInfo[i][hIntPos][2]      = cache_get_field_content_float(i, "Int_Z", dbhandle);
		HouseInfo[i][hOutInterior]    = cache_get_field_content_int(i, "OutInt", dbhandle);
		HouseInfo[i][hOutWorld]       = cache_get_field_content_int(i, "OutWorld", dbhandle);
		HouseInfo[i][hInsideInterior] = cache_get_field_content_int(i, "InsideInt", dbhandle);
		HouseInfo[i][hInsideWorld]    = cache_get_field_content_int(i, "InsideWorld", dbhandle);
		HouseInfo[i][hLocked]   	  = cache_get_field_content_int(i, "Locked", dbhandle);
		HouseInfo[i][hForSell]   	  = cache_get_field_content_int(i, "ForSell", dbhandle);
		HouseInfo[i][hPrice]   	  	  = cache_get_field_content_int(i, "Price", dbhandle);
		if(HouseInfo[i][hForSell] == 1)
		{
			HouseInfo[i][hPickup] = CreatePickup(1273, 23, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2], -1);
	        format(str, sizeof(str), "This house is for sell!\nPrice: %d\nType /buyhouse to buy it.\nType /enter to go inside.", HouseInfo[i][hPrice]);
			HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(str ,COLOR_ORANGE, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2],30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 7.0);
		}
		else
		{
			HouseInfo[i][hPickup] = CreatePickup(1273, 23, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2], -1);
	        format(str, sizeof(str), "House\nOwner: %s\nTo enter inside type /enter.", HouseInfo[i][hOwner]);
			HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(str ,COLOR_ORANGE, HouseInfo[i][hOutPos][0], HouseInfo[i][hOutPos][1], HouseInfo[i][hOutPos][2],30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 7.0);
		}
		printf("%d houses loaded.", rows);
	}
	return 1;
}
Reply


Messages In This Thread
Houses does not load. - by ShadowMortar - 21.01.2019, 14:57
Re: Houses does not load. - by ShadowMortar - 21.01.2019, 16:03
Re: Houses does not load. - by Calisthenics - 21.01.2019, 16:23
Re: Houses does not load. - by ShadowMortar - 21.01.2019, 16:24
Re: Houses does not load. - by Calisthenics - 21.01.2019, 16:57
Re: Houses does not load. - by ShadowMortar - 21.01.2019, 18:17
Re: Houses does not load. - by Calisthenics - 21.01.2019, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)