ERROR 028: invalid subscript
#1

Okay, I made an enum and want to create stock's , but i get the following error
Код:
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(4313) : error 028: invalid subscript (not an array or too many subscripts): "fcar"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(4313) : warning 215: expression has no effect
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(4313) : error 001: expected token: ";", but found "]"
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(4313) : error 029: invalid expression, assumed zero
C:\Users\Valentin$\Desktop\Server - Real one\Server - Real one\EMRP 0.3z\gamemodes\lvrp.pwn(4313) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
enum fcar
{
	carmodel,
	Float:fx,
	Float:fy,
	Float:fz,
	Float:fa,
	color1,
	color2,
	respawn,
	carteam,
	cartype, // 0 = driveable by all // 1 family restricted // 2 job restricted // 3 rentable
	modeltype, //0 car // 1 heli // 2 plane // 3 boat
	jobname[25],
	biznumber,
	plate[15],
	tmplocked,
	tmplockedby,
	carowner[MAX_STRING],
	carprice,
	reset,
	Components[CAR_COMPONENTS],
	dupekey[MAX_STRING],
	vw,
	paintjob,
	nitro,
}
Код:
stock CreateNewVehicle(vid)
{
	new file[64];
    format(file,sizeof(file),"cars/car%d.txt",vid);
    new Float: FX, Float: FY, Float: FZ, Float: FA;
    FX = dini_Float(file,"floatfx");
 	FY = dini_Float(file,"floatfy");
 	FZ = dini_Float(file,"floatfz");
 	FA = dini_Float(file,"floatfa");
    new COL = dini_Int(file,"color1");
    new COL2 = dini_Int(file,"color2");
    new CARTYP = dini_Int(file,"cartype");
    new MODELTYP = dini_Int(file,"modeltype");
    new BIZNUM = dini_Int(file,"biznumber");
    new CAROWN = dini_Int(file,"carowner");
    new CARPRICE = dini_Int(file,"carprice");
    new VW = dini_Int(file,"vw");
    new PAINTJ = dini_Int(file,"paintjob");
    new NITRO = dini_Int(file,"nitro");
    new PLAT = dini_Int(file,"plate");
    new TEAM = dini_Int(file,"carteam");
    new REST = dini_Int(file,"resetted");
    new COMP = dini_Int(file,"components");
	if(dini_Exists(file))
	{
		fcar[vid][gfloatfx] = FX;
		fcar[vid][gfloatfy] = FY;
		fcar[vid][gfloatfz] = FZ;
		fcar[vid][gfloatfa] = FA;
		fcar[vid][gcolor1] = COL;
		fcar[vid][gcolor2] = COL2;
		fcar[vid][gcartype] = CARTYP;
		fcar[vid][gmodeltype] = MODELTYP;
		fcar[vid][gbiznumb] = BIZNUM;
		fcar[vid][gcarowner] = CAROWN;
		fcar[vid][gcarprice] = CARPRICE;
		fcar[vid][gvw] = VW;
		fcar[vid][gpaintjob] = PAINTJ;
		fcar[vid][gnitro] = NITRO;
		fcar[vid][gplate] = PLAT;
		fcar[vid][gcarteam] = TEAM;
		fcar[vid][gresetted] = REST;
		fcar[vid][gcomponents] = COMP;

	}
	print("Vehicles loaded successfully.");
	return 1;
}
stock LoadVehicles()
{
	new file[64];
    for(new v=0; v<=MAX_VEHICLES; v++)
    {
	format(file,sizeof(file),"cars/car%d.txt",v);
    new Float: FX, Float: FY, Float: FZ, Float: FA;
    FX = dini_Float(file,"floatfx");
 	FY = dini_Float(file,"floatfy");
 	FZ = dini_Float(file,"floatfz");
 	FA = dini_Float(file,"floatfa");
    new COL = dini_Int(file,"color1");
    new COL2 = dini_Int(file,"color2");
    new CARTYP = dini_Int(file,"cartype");
    new MODELTYP = dini_Int(file,"modeltype");
    new BIZNUM = dini_Int(file,"biznumber");
    new CAROWN = dini_Int(file,"carowner");
    new CARPRICE = dini_Int(file,"carprice");
    new VW = dini_Int(file,"vw");
    new PAINTJ = dini_Int(file,"paintjob");
    new NITRO = dini_Int(file,"nitro");
    new PLAT = dini_Int(file,"plate");
    new TEAM = dini_Int(file,"carteam");
    new REST = dini_Int(file,"resetted");
    new COMP = dini_Int(file,"components");
	if(dini_Exists(file))
	{
		fcar[v][gfloatfx] = FX;
		fcar[v][gfloatfy] = FY;
		fcar[v][gfloatfz] = FZ;
		fcar[v][gfloatfa] = FA;
		fcar[v][gcolor1] = COL;
		fcar[v][gcolor2] = COL2;
		fcar[v][gcartype] = CARTYP;
		fcar[v][gmodeltype] = MODELTYP;
		fcar[v][gbiznumb] = BIZNUM;
		fcar[v][gcarowner] = CAROWN;
		fcar[v][gcarprice] = CARPRICE;
		fcar[v][gvw] = VW;
		fcar[v][gpaintjob] = PAINTJ;
		fcar[v][gnitro] = NITRO;
		fcar[v][gplate] = PLAT;
		fcar[v][gcarteam] = TEAM;
		fcar[v][gresetted] = REST;
		fcar[v][gcomponents] = COMP;
	}
	}
	print("Vehicles loaded successfully.");
	return 1;
}
stock ReturnNextUnusedVehicle()
{
	new hf[64];
	for(new h=0; h<=MAX_VEHICLES; h++)
	{
	    format(hf,sizeof(hf),"cars/car%d.txt",h);
	    if(dini_Exists(hf)) continue;
	    return h;
	}
	return -1;
}
Reply
#2

Is this on a filterscript? There is no OnFilterscript
Reply
#3

This is in gamemode
Reply
#4

which one is line 4313? highlight it for better
Reply
#5

fcar[vid][gfloatfx] = FX;
from both
Reply
#6

Quote:
Originally Posted by Somalez
Посмотреть сообщение
fcar[vid][gfloatfx] = FX;
from both
are you sure this is correct way?

try but not sure
pawn Код:
fcar[gfloatfx][vid] = FX;
Reply
#7

It doesn't work
Reply
#8

TRY

pawn Код:
enum fcar
{
    carmodel,
    Float:fx,
    Float:fy,
    Float:fz,
    Float:fa,
    color1,
    color2,
    respawn,
    carteam,
    cartype, // 0 = driveable by all // 1 family restricted // 2 job restricted // 3 rentable
    modeltype, //0 car // 1 heli // 2 plane // 3 boat
    jobname[25],
    biznumber,
    plate[15],
    tmplocked,
    tmplockedby,
    carowner[MAX_STRING],
    carprice,
    reset,
    Components[CAR_COMPONENTS],
    dupekey[MAX_STRING],
    vw,
    paintjob,
    nitro
}
Reply
#9

same...
Reply
#10

AGAIN
pawn Код:
enum fcar
{
    carmodel,
    Float:fx,
    Float:fy,
    Float:fz,
    Float:fa,
    color1,
    color2,
    respawn,
    carteam,
    cartype, // 0 = driveable by all // 1 family restricted // 2 job restricted // 3 rentable
    modeltype, //0 car // 1 heli // 2 plane // 3 boat
    jobname[25],
    biznumber,
    plate[15],
    tmplocked,
    tmplockedby,
    carowner[MAX_STRING],
    carprice,
    reset,
    Components[CAR_COMPONENTS],
    dupekey[MAX_STRING],
    vw,
    paintjob,
    nitro
};
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)