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: Tag mismatch.. (
/showthread.php?tid=574509)
Tag mismatch.. -
dundolina - 17.05.2015
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,"Нямаш достатъчно пари!");
}
Re: Tag mismatch.. -
dundolina - 17.05.2015
Help?
Re: Tag mismatch.. -
Crayder - 17.05.2015
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;
Re: Tag mismatch.. -
amirm3hdi - 17.05.2015
Did you use fuel as FLOAT ?
Re: Tag mismatch.. -
amirm3hdi - 17.05.2015
Quote:
Originally Posted by Crayder
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.
Re: Tag mismatch.. -
icra - 18.05.2015
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];