Help with my garage system
#1

I get this idk what i am doing wrong

Код:
C:\Users\Nate\Desktop\test\gamemodes\test.pwn(6517 -- 6530) : warning 213: tag mismatch
C:\Users\Nate\Desktop\test\gamemodes\test.pwn(6517 -- 6530) : error 032: array index out of bounds (variable "GarageInfo")
PHP код:
enum gInfo
{
    
gEnterX,
    
gEnterY,
    
gEnterZ,
    
gEnterAngle,
    
gExitX,
    
gExitY,
    
gExitZ,
    
gExitAngle,
    
gOwned,
    
gOwner,
    
gPrice,
    
gLocked,
    
gPickupID
};
new 
GarageInfo[SCRIPT_MAXGARGES][gInfo]; 
PHP код:
public SaveGarage()
{
    new 
idxFilefile2coordsstring[256];
    while (
idx sizeof(GarageInfo))
    {
        
format(coordsstringsizeof(coordsstring), "%f|%f|%f|%f|%f|%f|%f|%f|%d|%s|%d|%d\n",
        
GarageInfo[idx][gEnterX],
        
GarageInfo[idx][gEnterY],
        
GarageInfo[idx][gEnterZ],
        
GarageInfo[idx][gEnterAngle],
        
GarageInfo[idx][gExitX],
        
GarageInfo[idx][gExitY],
        
GarageInfo[idx][gExitZ],
        
GarageInfo[idx][gExitAngle],
        
GarageInfo[idx][gOwned],
        
GarageInfo[idx][gOwner],
        
GarageInfo[idx][gPrice],
        
GarageInfo[idx][gLocked],
        
GarageInfo[idx][hPickupID]);
        if(
idx == 0file2 fopen("garage.ini"io_write);
        else 
file2 fopen("garage.ini"io_append);
        
fwrite(file2coordsstring);
        
idx++;
        
fclose(file2);
    }
    return 
1;

PHP код:
public LoadGarage()
{
    
printf("Loading Garages...");
    new 
arrCoords[13][64], strFromFile2[256];
    new 
Filefile fopen("garage.ini"io_read);
    if (
file)
    {
        new 
idx;
        while (
idx sizeof(GarageInfo))
        {
            
fread(filestrFromFile2);
            
split(strFromFile2arrCoords',');
            
GarageInfo[idx][gEnterX] = floatstr(arrCoords[0]);
            
GarageInfo[idx][gEnterY] = floatstr(arrCoords[1]);
            
GarageInfo[idx][gEnterZ] = floatstr(arrCoords[2]);
            
GarageInfo[idx][gEnterAngle] = floatstr(arrCoords[3]);
            
GarageInfo[idx][gExitX] = floatstr(arrCoords[4]);
            
GarageInfo[idx][gExitY] = floatstr(arrCoords[5]);
            
GarageInfo[idx][gExitZ] = floatstr(arrCoords[6]);
            
GarageInfo[idx][gExitAngle] = floatstr(arrCoords[7]);
            
GarageInfo[idx][gOwned] = strval(arrCoords[8]);
            
strmid(GarageInfo[idx][gOwner], arrCoords[9], 0strlen(arrCoords[9]), 255);
            
GarageInfo[idx][gPrice] = strval(arrCoords[10]);
            
GarageInfo[idx][gLocked] = strval(arrCoords[11]);
            
GarageInfo[idx][gPickupID] = strval(arrCoords[12]);
            
idx++;
        }
    }
    
fclose(file);
    return 
1;

Reply


Messages In This Thread
Help with my garage system - by Hellman92 - 18.02.2016, 21:00
Re: Help with my garage system - by xTURBOx - 19.02.2016, 03:18
Re: Help with my garage system - by -CaRRoT - 19.02.2016, 03:56
Re: Help with my garage system - by Vince - 19.02.2016, 05:21
Re: Help with my garage system - by NelsonM - 19.02.2016, 05:42
Re: Help with my garage system - by Hellman92 - 19.02.2016, 06:00
Re: Help with my garage system - by Vince - 19.02.2016, 11:56
Re: Help with my garage system - by Hellman92 - 19.02.2016, 12:25

Forum Jump:


Users browsing this thread: 1 Guest(s)