Please check,undefined symbol errors!
#1

Код:
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(903) : error 021: symbol already defined: "frename"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(953) : error 017: undefined symbol "VehicleStatistics"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(954) : error 017: undefined symbol "VehicleStatistics"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(955) : error 017: undefined symbol "VehicleStatistics"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(956) : error 017: undefined symbol "VehicleStatistics"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(956) : error 029: invalid expression, assumed zero
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(956) : warning 215: expression has no effect
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(956) : error 001: expected token: ";", but found "]"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(956) : fatal error 107: too many error messages on one line
Rows(953,954,955,956)

Код:
VehicleStatistics[i][vehicle_dealership] = INI_ReadInt("vehicle_dealership");
VehicleStatistics[i][vehicle_model] = INI_ReadInt("vehicle_model");
VehicleStatistics[i][vehicle_price] = INI_ReadInt("vehicle_price");
VehicleStatistics[i][vehicle_position][1] = INI_ReadFloat("vehicle_x");
Reply
#2

1st Error
You've defined frename twice within the code or through the entire script(Including FS's).

2nd -4th Error
You need to define the symbol
pawn Код:
new VehicleStatistics[225];
5th+ Error
Not enough info to go on, try showing me a little more code, including lines below and above the current selection, and also show me all the defined definitions.
Reply
#3

Код:
stock LoadDealershipCars()
{
	new
		file[100],
		file2[100],
		string[128],
		vehicle;

	for(new i = 1; i < MAX_VEHICLES; i++)
	{
		format(file, sizeof(file), "dealerships/vehicles/%d.cfg", i);
		if(!fexist(file)) continue;
		if(fexist(file) && INI_Open(file))
		{
		    if(GetVehicleModel(i) > 399)
		    {
                for (new v = 1; v < MAX_VEHICLES; v ++)
				{
		            if (GetVehicleModel(v) == 0)
					{
		                i = v;
		                break;
					}
				}
				format(file2, sizeof(file2), "dealerships/vehicles/%d.cfg", i);
				frename(file, file2);
			}
		    VehicleStatistics[i][vehicle_dealership] = INI_ReadInt("vehicle_dealership");
			VehicleStatistics[i][vehicle_model] = INI_ReadInt("vehicle_model");
			VehicleStatistics[i][vehicle_price] = INI_ReadInt("vehicle_price");
   			VehicleStatistics[i][vehicle_position][1] = INI_ReadFloat("vehicle_x");
		    VehicleStatistics[i][vehicle_position][2] = INI_ReadFloat("vehicle_y");
		    VehicleStatistics[i][vehicle_position][3] = INI_ReadFloat("vehicle_z");
			VehicleStatistics[i][vehicle_position][4] = INI_ReadFloat("vehicle_angle");
      		VehicleStatistics[i][vehicle_onsale] = INI_ReadInt("vehicle_onsale");
			vehicle = CreateVehicle(VehicleStatistics[i][vehicle_model], VehicleStatistics[i][vehicle_position][1], VehicleStatistics[i][vehicle_position][2], VehicleStatistics[i][vehicle_position][3], VehicleStatistics[i][vehicle_position][4], 0, 0, -1);
			format(string, sizeof(string), "{00C3FF}%s On Sale - Price: $%d{00C3FF}", GetVehicleName(vehicle), VehicleStatistics[i][vehicle_price]);
			VehicleStatistics[i][vehicle_label] = Create3DTextLabel(string, color_orange, VehicleStatistics[i][vehicle_position][1], VehicleStatistics[i][vehicle_position][2], VehicleStatistics[i][vehicle_position][3], 10.0, 0);
			INI_Close();
		}
	}
	return 1;
}
Now i'we done that all...there is still one error Undefined symbol VehicleStatistics and Undefined symbol vehicle_dealership

Код:
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(937) : error 017: undefined symbol "VehicleStatistics"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(937) : error 029: invalid expression, assumed zero
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(937) : error 017: undefined symbol "vehicle_dealership"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(937) : fatal error 107: too many error messages on one line
Reply
#4

pawn Код:
stock LoadDealershipCars()
{
    new
        file[100],
        file2[100],
        string[128],
        vehicle,
                VehicleStatistics[225],
                vehicle_dealership[225];

    for(new i = 1; i < MAX_VEHICLES; i++)
    {
        format(file, sizeof(file), "dealerships/vehicles/%d.cfg", i);
        if(!fexist(file)) continue;
        if(fexist(file) && INI_Open(file))
        {
            if(GetVehicleModel(i) > 399)
            {
                    for (new v = 1; v < MAX_VEHICLES; v ++)
                {
                    if (GetVehicleModel(v) == 0)
                    {
                        i = v;
                        break;
                    }
                }
                format(file2, sizeof(file2), "dealerships/vehicles/%d.cfg", i);
                frename(file, file2);
            }
                VehicleStatistics[i][vehicle_dealership] = INI_ReadInt("vehicle_dealership");
            VehicleStatistics[i][vehicle_model] = INI_ReadInt("vehicle_model");
            VehicleStatistics[i][vehicle_price] = INI_ReadInt("vehicle_price");
            VehicleStatistics[i][vehicle_position][1] = INI_ReadFloat("vehicle_x");
                VehicleStatistics[i][vehicle_position][2] = INI_ReadFloat("vehicle_y");
                VehicleStatistics[i][vehicle_position][3] = INI_ReadFloat("vehicle_z");
            VehicleStatistics[i][vehicle_position][4] = INI_ReadFloat("vehicle_angle");
                    VehicleStatistics[i][vehicle_onsale] = INI_ReadInt("vehicle_onsale");
            vehicle = CreateVehicle(VehicleStatistics[i][vehicle_model], VehicleStatistics[i][vehicle_position][1], VehicleStatistics[i][vehicle_position][2], VehicleStatistics[i][vehicle_position][3], VehicleStatistics[i][vehicle_position][4], 0, 0, -1);
            format(string, sizeof(string), "{00C3FF}%s On Sale - Price: $%d{00C3FF}", GetVehicleName(vehicle), VehicleStatistics[i][vehicle_price]);
            VehicleStatistics[i][vehicle_label] = Create3DTextLabel(string, color_orange, VehicleStatistics[i][vehicle_position][1], VehicleStatistics[i][vehicle_position][2], VehicleStatistics[i][vehicle_position][3], 10.0, 0);
            INI_Close();
        }
    }
    return 1;
}
The Fix

Try this and post back the last error, if there is one?
Reply
#5

I've got 4 errors

Код:
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(916) : warning 219: local variable "VehicleStatistics" shadows a variable at a preceding level
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(935) : warning 217: loose indentation
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(938) : warning 215: expression has no effect
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(938) : error 001: expected token: ";", but found "["
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(938) : error 029: invalid expression, assumed zero
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(938) : warning 215: expression has no effect
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(938) : error 001: expected token: ";", but found "]"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e\gamemodes\egrp.pwn(938) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

Show me the main place of where "VehicleStatistics" is being used. Have you made it an array?
You may need to in order to use it like one. Also add it to the main script and not just in one function. That way you don't have to keep making a new
pawn Код:
new
function.
Reply
#7

How do you meen main place. Its used in like LoadDealershipCars,SaveDealership,CreateDealership Vehicle...what should i post here...
Reply
#8

Put this at the top of your script
pawn Код:
enum vehicle_stats
{
    vehicle_dealership,
    vehicle_model,
    vehicle_price,
    Float:vehicle_position[5],
    Text3D:vehicle_label,
    vehicle_onsale
};

new VehicleStatistics[MAX_VEHICLES][vehicle_stats];
I'm guessing this might help?

It's from this:

https://sampforum.blast.hk/showthread.php?tid=299738

and has the same function and names as yours, so im guessing this is what your using?
Reply
#9

Yes,that what am i using. But still i am getting

Код:
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(916) : warning 219: local variable "VehicleStatistics" shadows a variable at a preceding level
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(935) : warning 217: loose indentation
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(938) : warning 215: expression has no effect
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(938) : error 001: expected token: ";", but found "["
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(938) : error 029: invalid expression, assumed zero
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(938) : warning 215: expression has no effect
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(938) : error 001: expected token: ";", but found "]"
D:\Users\ROBERT\Desktop\- Exclusive Gaming RolePlay - 0.3e(pogledat na forumu jel odgovoreno)\gamemodes\egrp.pwn(938) : fatal error 107: too many error messages on one line
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)