More garage help
#1

Here is what i am getting the errors in i think
Код:
// Garage Settings
enum garageInfo
{
	gLevel,
	gPrice,
	gStatus,
	gOwner[32],
	Float:gX,
	Float:gY,
	Float:gZ,
	gPickup,
	Text3D:gText
}
new GarageInfo[MAX_GARAGES][garageInfo];

stock LoadGarages()
{
	new binfo[21][32];
	new string[256];
	new File:file = fopen("garages.cfg", io_read);
	if(file)
	{
	    new idx = 1;
		while(idx < MAX_GARAGES)
		{
		    fread(file, string);
		    split(string, binfo, '|');
		    GarageInfo[idx][gLevel] = strval(binfo[0]);
		    GarageInfo[idx][gPrice] = strval(binfo[1]);
		    GarageInfo[idx][gStatus] = strval(binfo[2]);
		    format(GarageInfo[idx][gOwner], 32, "%s", binfo[3]);
		    GarageInfo[idx][gX] = floatstr(binfo[4]);
		    GarageInfo[idx][gY] = floatstr(binfo[5]);
		    GarageInfo[idx][gZ] = floatstr(binfo[6]);
			if(GarageInfo[idx][gLevel])
			{
			    GarageInfo[idx][gPickup] = CreateDynamicPickup(1272, 1, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ], 0);
                if(!strcmp("The State", GarageInfo[idx][gOwner])) format(string, sizeof(string), "ID: %d\nGarage (Lvl: %d)\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
				else format(string, sizeof(string), "ID: %d\nGarage (Lvl: %d)\nOwner: %s\nStatus: %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], RHS(idx));
				GarageInfo[idx][hText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]+0.3, 15);

			}
			idx++;
	    }
	}
	print("Garages loaded successfully.");
	return 1;
}

stock SaveGarages()
{
	new idx = 1, File:file;
	new string[256];
	while(idx < MAX_GARAGES)
	{
	    format(string, sizeof(string), "%d|%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
	    GarageInfo[idx][gLevel],
	    GarageInfo[idx][gPrice],
	    GarageInfo[idx][gStatus],
	    GarageInfo[idx][gOwner],
	    GarageInfo[idx][gX],
	    GarageInfo[idx][gY],
	    GarageInfo[idx][gZ],
		);
	    if(idx == 1)
	    {
	        file = fopen("garages.cfg", io_write);
	    }
	    else
	    {
	    	file = fopen("garages.cfg", io_append);
	    }
		fwrite(file, string);
		fclose(file);
		idx++;
	}
	print("Garages saved successfully.");
}
Here are the codes
Код:
C:\Users\Ryan Wharton\Desktop\zGaming Roleplay\gamemodes\ZRP.pwn(1950) : warning 213: tag mismatch
C:\Users\Ryan Wharton\Desktop\zGaming Roleplay\gamemodes\ZRP.pwn(1950) : error 032: array index out of bounds (variable "GarageInfo")
C:\Users\Ryan Wharton\Desktop\zGaming Roleplay\gamemodes\ZRP.pwn(1966 -- 1974) : error 029: invalid expression, assumed zero
C:\Users\Ryan Wharton\Desktop\zGaming Roleplay\gamemodes\ZRP.pwn(1966 -- 1974) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply


Messages In This Thread
More garage help - by Ryan_Michael - 20.07.2012, 00:18
Re: More garage help - by nepstep - 20.07.2012, 00:21
Re: More garage help - by Ryan_Michael - 20.07.2012, 01:51
Re: More garage help - by Ryan_Michael - 20.07.2012, 02:00
Re: More garage help - by jeremy8810 - 20.07.2012, 02:02
Re: More garage help - by Ryan_Michael - 20.07.2012, 02:21
Re: More garage help - by jeremy8810 - 20.07.2012, 02:30
Re: More garage help - by jeremy8810 - 20.07.2012, 02:35
Re: More garage help - by Ryan_Michael - 20.07.2012, 02:40
Re: More garage help - by newbienoob - 20.07.2012, 02:47

Forum Jump:


Users browsing this thread: 1 Guest(s)