[debug] Run time error 4: "Array index out of bounds"
#1

hi
i have a problem when i try to run my gamemode
ss :


this is LoadHouses function :
Код HTML:
function LoadHouses()
{
    new PropertyString[1024];
	houses = cache_num_rows();
	for(new i = 1; i <= houses; i++)
	{
		new j = i - 1;
		HouseInfo[i][hID] 					= i;
		HouseInfo[i][hEntrancex] 			= cache_get_field_content_float(j, "Entrancex");
		HouseInfo[i][hEntrancey] 			= cache_get_field_content_float(j, "Entrancey");
		HouseInfo[i][hEntrancez] 			= cache_get_field_content_float(j, "Entrancez");
		HouseInfo[i][hExitx] 				= cache_get_field_content_float(j, "Exitx");
		HouseInfo[i][hExity] 				= cache_get_field_content_float(j, "Exity");
		HouseInfo[i][hExitz] 				= cache_get_field_content_float(j, "Exitz");
		HouseInfo[i][hHealth] 				= cache_get_field_content_int(j, "Health");
		HouseInfo[i][hArmour] 				= cache_get_field_content_int(j, "Armour");
		cache_get_field_content(j, "Owner", HouseInfo[i][hOwner], SQL, 129);
		HouseInfo[i][hValue] 				= cache_get_field_content_int(j, "Value");
		HouseInfo[i][hInt] 					= cache_get_field_content_int(j, "Int");
		HouseInfo[i][hLock] 				= cache_get_field_content_int(j, "Lockk");
		HouseInfo[i][hOwned] 				= cache_get_field_content_int(j, "Owned");
		HouseInfo[i][hRent] 				= cache_get_field_content_int(j, "Rent");
		HouseInfo[i][hRentabil] 			= cache_get_field_content_int(j, "Rentabil");
		HouseInfo[i][hTakings] 				= cache_get_field_content_int(j, "Takings");
		HouseInfo[i][hDate] 				= cache_get_field_content_int(j, "Date");
		HouseInfo[i][hLevel] 				= cache_get_field_content_int(j, "Level");
		if(HouseInfo[i][hOwned] == 0)
		{
			format(PropertyString, sizeof(PropertyString), "{009900}House %d\nThis house is for sale\nPrice: {00FF00}$%s\n{009900}Level: {00FF00}%d\n{009900}Type {00FF00}/buyhouse {009900}to buy",i,Decimal(HouseInfo[i][hValue]),HouseInfo[i][hLevel]);
			HouseLabel[i] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
		}
		else if(HouseInfo[i][hOwned] == 1)
		{
			if(HouseInfo[i][hRentabil] == 1)
			{
				format(PropertyString, sizeof(PropertyString), "{009900}House %d\nOwner: {00FF00}%s\n{009900}Level: {00FF00}%d",i,HouseInfo[i][hOwner],HouseInfo[i][hLevel]);
				HouseLabel[i] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
			}
			else
			{
				format(PropertyString, sizeof(PropertyString), "{009900}House %d\nOwner: {00FF00}%s\n{009900}Level: {00FF00}%d\n{009900}Rent: {00FF00}$%s\n{009900}to rent a room type {00FF00}/rentroom",i,HouseInfo[i][hOwner],HouseInfo[i][hLevel],Decimal(HouseInfo[i][hRent]));
				HouseLabel[i] = CreateDynamic3DTextLabel(PropertyString ,0x09FF00FF,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez],25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
			}
		}
	}
	printf("[MYSQL] Houses: %d", houses);
}
what i must do ?
Reply


Messages In This Thread
[debug] Run time error 4: "Array index out of bounds" - by SH0x - 19.02.2017, 19:32
Respuesta: [debug] Run time error 4: "Array index out of bounds" - by Eloy - 19.02.2017, 20:54
Re: [debug] Run time error 4: "Array index out of bounds" - by PowerPC603 - 19.02.2017, 21:44
Re: Respuesta: [debug] Run time error 4: "Array index out of bounds" - by SH0x - 20.02.2017, 10:01
Re: [debug] Run time error 4: "Array index out of bounds" - by DRIFT_HUNTER - 20.02.2017, 10:26

Forum Jump:


Users browsing this thread: 1 Guest(s)