[HELP]Errors
#1

Line:

Код:
if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID)
Errors:

Код:
warning 213: tag mismatch
error 001: expected token: ")", but found "["
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
fatal error 107: too many error messages on one line
HELP PLEASE
Reply
#2

Are you sure the error isn't at the previous line?
Reply
#3

I am not sure, but try that?

pawn Код:
if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID);
Reply
#4

Post the enum for VehicleEnum if what arakuta said isn't true.
Reply
#5

Quote:
Originally Posted by CesarLT
Посмотреть сообщение
I am not sure, but try that?

pawn Код:
if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID);
not working this is the complete function:

Код:
stock CreatePlayerVehicle(playerid, playervehicleid, modelid, Float: x, Float: y, Float: z, Float: angle, color1, color2, price)
{
	if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID)
	{
	    PlayerCars++;
        carsforplayer[playerid]++;
		PlayerVehicleInfo[playerid][playervehicleid][veh_model] = modelid;
		PlayerVehicleInfo[playerid][playervehicleid][veh_x] = x;
		PlayerVehicleInfo[playerid][playervehicleid][veh_y] = y;
		PlayerVehicleInfo[playerid][playervehicleid][veh_z] = z;
		PlayerVehicleInfo[playerid][playervehicleid][veh_rot] = angle;
		PlayerVehicleInfo[playerid][playervehicleid][veh_world] = GetPlayerVirtualWorld(playerid);
		PlayerVehicleInfo[playerid][playervehicleid][veh_colors[1]] = color1;
		PlayerVehicleInfo[playerid][playervehicleid][veh_colors[2]] = color2;
		PlayerVehicleInfo[playerid][playervehicleid][veh_price] = price;
		PlayerVehicleInfo[playerid][playervehicleid][veh_locked] = 0;
		PlayerVehicleInfo[playerid][playervehicleid][veh_impounded] = 0;
		for(new m = 0; m < MAX_MODS; m++)
	    {
	    	PlayerVehicleInfo[playerid][playervehicleid][veh_comp][m] = 0;
		}
		new carcreated = CreateVehicle(modelid,x,y,z,angle,color1,color2,-1);
		PlayerVehicleInfo[playerid][playervehicleid][veh_id] = carcreated;
		SetVehicleVirtualWorld(carcreated, PlayerVehicleInfo[playerid][playervehicleid][pvVW]);
		//SetVehicleNumberPlate(carcreated, PlayerVehicleInfo[playerid][playervehicleid][pvNumberPlate]);
		return carcreated;
	}
	return INVALID_PLAYER_VEHICLE_ID;
}
VehicleEnum:

Код:
enum VEnum
{
	veh_id,
	veh_plate[MAX_PLATE_LENGTH+1],
	veh_owner[MAX_PLAYER_NAME],
	veh_model,
	veh_owned,
	veh_price,
	Float:veh_x,
	Float:veh_y,
	Float:veh_z,
	Float:veh_rot,
	veh_comp[18],
	veh_colors[3],
	veh_paintjob,
	veh_locked,
	veh_slot,
	veh_int,
	veh_world,
	veh_neon,
	veh_impounded,
	veh_impoundprice,
	veh_haslock,
	veh_registerdate[7],
	veh_trunkgun1,
	veh_trunkgun2,
	veh_trunkgun3,
	veh_trunkgun4,
	Float:veh_trunkarmor,
	veh_trunkcocaine,
	veh_trunkweed,
	veh_trunkmeth,
	veh_trunkheroin,
	veh_trunkmats,
	veh_trunkcash,
	veh_plateset
};
Reply
#6

Post the line that has something like this. It's more likely right below the enum VEnum.
pawn Код:
new VehicleEnum[//rest of the code.
Reply
#7

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
Post the line that has something like this. It's more likely right below the enum VEnum.
pawn Код:
new VehicleEnum[//rest of the code.
Код:
new VehicleEnum[MAX_VEHICLES][VEnum];
Reply
#8

Try this. Replace this code
pawn Код:
if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID)
with this code:
pawn Код:
if(VehicleEnum[playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID)
Reply
#9

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
Try this. Replace this code
pawn Код:
if(VehicleEnum[playerid][playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID)
with this code:
pawn Код:
if(VehicleEnum[playervehicleid][veh_id] == INVALID_PLAYER_VEHICLE_ID)
THANKS! The error now is this:

carsforplayer[playerid]++;

C:\Users\Mijail\Desktop\Servidor\gamemodes\rp.pwn( 96617) : error 017: undefined symbol "carsforplayer"
C:\Users\Mijail\Desktop\Servidor\gamemodes\rp.pwn( 96617) : warning 215: expression has no effect
C:\Users\Mijail\Desktop\Servidor\gamemodes\rp.pwn( 96617) : error 001: expected token: ";", but found "]"
C:\Users\Mijail\Desktop\Servidor\gamemodes\rp.pwn( 96617) : error 029: invalid expression, assumed zero
C:\Users\Mijail\Desktop\Servidor\gamemodes\rp.pwn( 96617) : fatal error 107: too many error messages on one line
Reply
#10

Np

Press CONTROL+F and type in carsforplayer.

If it exists; copy and paste it above 'main()'.

If it doesn't exist; put this code above main().

pawn Код:
new carsforplayer[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)