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

Quote:
Originally Posted by Eloy
Посмотреть сообщение
Try

PHP код:

function LoadHouses()
{
        new 
PropertyString[1024], filashouses;
    if(
cache_get_row_count(filas))
{
    for(new 
0<= filasi++)
    {
        new 
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], SQL129);
        
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(PropertyStringsizeof(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],25INVALID_PLAYER_IDINVALID_VEHICLE_ID1, -1, -1, -1100.0);
        }
        else if(
HouseInfo[i][hOwned] == 1)
        {
            if(
HouseInfo[i][hRentabil] == 1)
            {
                
format(PropertyStringsizeof(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],25INVALID_PLAYER_IDINVALID_VEHICLE_ID1, -1, -1, -1100.0);
            }
            else
            {
                
format(PropertyStringsizeof(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],25INVALID_PLAYER_IDINVALID_VEHICLE_ID1, -1, -1, -1100.0);
            }
        }
houses++;
    }
}
    
printf("[MYSQL] Houses: %d"houses);

with this when i run server that load just 1 houses
but i have 999 houses in my db
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)