warning 213: tag mismatch
#1

pawn Код:
AVehicleData[vid][Fuel] = AVehicleData[vid][Fuel] -0.1;
Код:
warning 213: tag mismatch
How to fix it ?
Reply
#2

Fuel is it Float ? at enum add Float:Fuel,
Reply
#3

pawn Код:
enum TVehicleData
{
    Fuel
}
It is added
Reply
#4

pawn Код:
enum TVehicleData
{
    Float:Fuel
}
Reply
#5

You have to declare Fuel as a float in the enum.
Reply
#6

pawn Код:
enum TVehicleData
{
    Float:Fuel
}
Код:
Fuel.pwn(284) : warning 213: tag mismatch
pawn Код:
return AVehicleData[vehicleid][Fuel];
- line 284
Reply
#7

Declare the function with the Float: tag as well. If you get a warning about "forcing reparse" then add a forward declaration (like with public), too.
Reply
#8

The problem is here:
Код:
AVehicleData[vid][Fuel] = AVehicleData[vid][Fuel] -0.1;
When I change the code to this, I don't get errors, but gasoline down fast
Код:
AVehicleData[vid][Fuel] = AVehicleData[vid][Fuel] -1;
Here's the whole code without errors, but gasoline down fast!:
pawn Код:
if (GetPlayerVehicleSeat(playerid) == 0)
if ((final_speed_int > 10) && (AVehicleData[vid][Float:Fuel] > 0))
AVehicleData[vid][Float:Fuel] = AVehicleData[vid][Float:Fuel] -1;
Reply
#9

If someone help me I'll give him +rep
Reply
#10

Install Float:Fuel in your enum.
pawn Код:
enum TVehicleData
{
    Float:Fuel
}
new AVehicleData[MAX_VEHICLES][TVehicleData];
then use it like this:

pawn Код:
if (GetPlayerVehicleSeat(playerid) == 0)
if ((final_speed_int > 10) && (AVehicleData[vid][Fuel] > 0))
AVehicleData[vid][Fuel] = AVehicleData[vid][Fuel] - 0.1;
OR

pawn Код:
AVehicleData[vid][Fuel] -= 0.1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)