SA-MP Forums Archive
warning 213: tag mismatch - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning 213: tag mismatch (/showthread.php?tid=486822)



warning 213: tag mismatch [+REP] - maxy153 - 10.01.2014

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


Re: warning 213: tag mismatch - ikey07 - 10.01.2014

Fuel is it Float ? at enum add Float:Fuel,


Re: warning 213: tag mismatch - maxy153 - 10.01.2014

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


Re: warning 213: tag mismatch - J4mmyHD - 10.01.2014

pawn Код:
enum TVehicleData
{
    Float:Fuel
}



Respuesta: warning 213: tag mismatch - JustBored - 10.01.2014

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


Re: warning 213: tag mismatch - maxy153 - 10.01.2014

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


Re: warning 213: tag mismatch - Vince - 10.01.2014

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.


Re: warning 213: tag mismatch - maxy153 - 10.01.2014

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;



Re: warning 213: tag mismatch - maxy153 - 10.01.2014

If someone help me I'll give him +rep


Re: warning 213: tag mismatch - ACI - 10.01.2014

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;