PDA

View Full Version : Tag mismatch..


dundolina
17/05/2015, 08:12 PM
Hello i have this warning: "warning 213: tag mismatch" on this line: if (fuel[vid] > 100.0) fuel[vid] = 100.0;

Here is more lines:

if(PlayerInfo[playerid][pCash] >= 3000)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 2149.8328,2748.2905,10.5474)) F1 -= 10;
else if(IsPlayerInRangeOfPoint(playerid, 10.0, 1944.1652,-1769.8917,13.1157)) F2 -= 10;
else if(IsPlayerInRangeOfPoint(playerid, 10.0, 2116.6611,922.4604,10.5474)) F3 -= 10;
else if(IsPlayerInRangeOfPoint(playerid, 10.0, 2204.3835,2473.3994,10.5474)) F4 -= 10;

fuel[vid] = fuel[vid] +10;
if (fuel[vid] > 100.0) fuel[vid] = 100.0;
GivePlayerMoney(playerid, -3000);
SendClientMessage(playerid,COLOR_YELLOW,"Ти добави 10 литра бензин на твоето превозно средство и това ти струваше $3000!");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1,"Нямаш достатъчно пари!");
}

dundolina
17/05/2015, 09:14 PM
Help?

Crayder
17/05/2015, 09:29 PM
Search for "new fuel["
Replace with "new Float:fuel["

Or something along those lines. You're not using the correct tag on 'fuel'.

EDIT:

Actually, just use this:
if (fuel[vid] > 100) fuel[vid] = 100;

amirm3hdi
17/05/2015, 09:30 PM
Did you use fuel as FLOAT ?

amirm3hdi
17/05/2015, 09:33 PM
Search for "new fuel["
Replace with "new Float:fuel["

Or something along those lines. You're not using the correct tag on 'fuel'.

EDIT:

Actually, just use this:
if (fuel[vid] > 100) fuel[vid] = 100;

That's correct if he doesn't want to use it as Float...
removing '.0' is better.

icra
18/05/2015, 03:58 AM
Pawn compiler recognizes ".0" as a second dimension for the variable, reading it as a Float.
Make sure when you declare "Fuel" you declare it as a Float.

Example:


new Float:fuel[MAX_VEHICLES];