Affichage des articles dont le libellé est Error en código. Afficher tous les articles
Affichage des articles dont le libellé est Error en código. Afficher tous les articles

mardi 19 juillet 2016

Error en código, "(variable "arrCoords")"

Tengo un problema con un sistema de guardado de tuning, ya que lo tome como base de otro gm y adaptado a la mia pero tengo unos errores que he intentado solucionar y no he podido y quisiera que me ayudaran por favor.

Error:

Code:

D:\Text\gamemodes\Text.pwn(12955) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12956) : error 032: array index out of bounds (variable "arrCoords") 
D:\Text\gamemodes\Text.pwn(12957) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12958) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12959) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12960) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12961) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12962) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12963) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12964) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12965) : error 032: array index out of bounds (variable "arrCoords")
D:\Text\gamemodes\Text.pwn(12966) : error 032: array index out of bounds (variable "arrCoords")
Pawn compiler 3.2.3664                  Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.

Code:

public LoadCar()
{
        new arrCoords[13][64];
        new strFromFile2[256];
        new File: file = fopen("cars.cfg", io_read);
        if (file)
        {
                new idx = VV_DESDE;
                while (idx < sizeof(CarInfo))
                {
                        fread(file, strFromFile2);
                        split(strFromFile2, arrCoords, ',');
                        CarInfo[idx][cModel] = strval(arrCoords[0]);
                        CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
                        CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
                        CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
                        CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
                        CarInfo[idx][cColorOne] = strval(arrCoords[5]);
                        CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
                        strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
                        strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
                        CarInfo[idx][cValue] = strval(arrCoords[9]);
                        CarInfo[idx][cLicense] = strval(arrCoords[10]);
                        CarInfo[idx][cOwned] = strval(arrCoords[11]);
                        CarInfo[idx][cLock] = strval(arrCoords[12]);
            CarInfo[idx][cSpoiler] = strval(arrCoords[13]);
            CarInfo[idx][cHood] = strval(arrCoords[14]);
            CarInfo[idx][cRoof] = strval(arrCoords[15]);
            CarInfo[idx][cSideskirt] = strval(arrCoords[16]);
            CarInfo[idx][cNitro] = strval(arrCoords[17]);
            CarInfo[idx][cLamps] = strval(arrCoords[18]);
            CarInfo[idx][cExhaust] = strval(arrCoords[19]);
            CarInfo[idx][cWheel] = strval(arrCoords[20]);
            CarInfo[idx][cHydraulics] = strval(arrCoords[21]);
            CarInfo[idx][cPaintjob] = strval(arrCoords[22]);
            CarInfo[idx][cFrontBumper] = strval(arrCoords[23]);
            CarInfo[idx][cRearBumper] = strval(arrCoords[24]);
            CarInfo[idx][cVents] = strval(arrCoords[25]);
                        printf("ID: %d Owner:%s Modelo: %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cDescription]);
                        idx++;
                }
        }
        return 1;
}
Donde comienzan los errores, son en estas lineas:

Code:

                    CarInfo[idx][cSpoiler] = strval(arrCoords[13]);
            CarInfo[idx][cHood] = strval(arrCoords[14]);
            CarInfo[idx][cRoof] = strval(arrCoords[15]);
            CarInfo[idx][cSideskirt] = strval(arrCoords[16]);
            CarInfo[idx][cNitro] = strval(arrCoords[17]);
            CarInfo[idx][cLamps] = strval(arrCoords[18]);
            CarInfo[idx][cExhaust] = strval(arrCoords[19]);
            CarInfo[idx][cWheel] = strval(arrCoords[20]);
            CarInfo[idx][cHydraulics] = strval(arrCoords[21]);
            CarInfo[idx][cPaintjob] = strval(arrCoords[22]);
            CarInfo[idx][cFrontBumper] = strval(arrCoords[23]);
            CarInfo[idx][cRearBumper] = strval(arrCoords[24]);
            CarInfo[idx][cVents] = strval(arrCoords[25]);
Gracias de antemano..

Let's block ads! (Why?)



Error en código, "(variable "arrCoords")"