Tag mismatch..
#1

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,"Нямаш достатъчно пари!");
}
Reply
#2

Help?
Reply
#3

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;
Reply
#4

Did you use fuel as FLOAT ?
Reply
#5

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.
Reply
#6

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];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)