[HELP] Floatstr 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Floatstr tag mismatch (
/showthread.php?tid=197605)
[HELP] Floatstr tag mismatch -
Pooh7 - 09.12.2010
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?
Re: [HELP] Floatstr tag mismatch -
JaTochNietDan - 09.12.2010
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];
Re: [HELP] Floatstr tag mismatch -
Pooh7 - 09.12.2010
Thank you