[HELP] Floatstr tag mismatch
#1

I have 4 warnings on my script.

Код:
E:\DOCUME~1\Nikola\Desktop\GAMEMO~1\D-LINK~1\GAMEMO~1\nl.pwn(56409) : warning 213: tag mismatch
E:\DOCUME~1\Nikola\Desktop\GAMEMO~1\D-LINK~1\GAMEMO~1\nl.pwn(56410) : warning 213: tag mismatch
E:\DOCUME~1\Nikola\Desktop\GAMEMO~1\D-LINK~1\GAMEMO~1\nl.pwn(56411) : warning 213: tag mismatch
E:\DOCUME~1\Nikola\Desktop\GAMEMO~1\D-LINK~1\GAMEMO~1\nl.pwn(56412) : warning 213: tag mismatch
Function:

pawn Код:
public UcitajVozila()
{
    new arrCoords[11][256];
    new strFromFile2[256];
    new File: file = fopen("VozilaOwnership.cfg", io_read);
    if(file)
    {
        new idx = 0;
        while (idx < sizeof(Vozilo))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, '|');
            Vozilo[idx][vModel] = strval(arrCoords[0]);
            Vozilo[idx][vPozX] = floatstr(arrCoords[1]); // <--------------------- WARNING 1
            Vozilo[idx][vPozY] = floatstr(arrCoords[2]); // <--------------------- WARNING 2
            Vozilo[idx][vPozZ] = floatstr(arrCoords[3]); // <--------------------- WARNING 3
            Vozilo[idx][vPozA] = floatstr(arrCoords[4]); // <--------------------- WARNING 4
            Vozilo[idx][vBoja1] = strval(arrCoords[5]);
            Vozilo[idx][vBoja2] = strval(arrCoords[6]);
            strmid(Vozilo[idx][vVlasnik], arrCoords[7], 0, strlen(arrCoords[7]), 255);
            strmid(Vozilo[idx][vOpis], arrCoords[8], 0, strlen(arrCoords[8]), 255);
            Vozilo[idx][vCena] = strval(arrCoords[9]);
            Vozilo[idx][vImaVlasnika] = strval(arrCoords[10]);
            printf("Vozilo: %d Vlasnik: %s", idx, Vozilo[idx][vVlasnik]);
            idx++;
        }
    }
    return 1;
}
It's function for loading vehicles from file.


enum:
pawn Код:
enum vInfo
{
    vModel,
    vPozX,
    vPozY,
    vPozZ,
    vPozA,
    vBoja1,
    vBoja2,
    vVlasnik[MAX_PLAYER_NAME],
    vOpis[64],
    vCena,
    vImaVlasnika,
};
new Vozilo[64][vInfo];
How to fix that warnings?
Reply
#2

You need to initialize the variables as floats.

pawn Код:
enum vInfo
{
    vModel,
    Float:vPozX,
    Float:vPozY,
    Float:vPozZ,
    Float:vPozA,
    vBoja1,
    vBoja2,
    vVlasnik[MAX_PLAYER_NAME],
    vOpis[64],
    vCena,
    vImaVlasnika,
};
new Vozilo[64][vInfo];
Reply
#3

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)