[AJUDA] ERRO salvar, carregar - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] ERRO salvar, carregar (
/showthread.php?tid=339594)
[AJUDA] ERRO salvar, carregar -
peumenezes - 04.05.2012
pawn Код:
public LoadStuff()
{
new arrCoords[4][64];
new strFromFile2[128];
new File: file = fopen("Configs/stuff.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
Jackpot = strval(arrCoords[0]);
Tax = strval(arrCoords[1]);
TaxValue = strval(arrCoords[2]);
fclose(file);
}
return 1;
}
public SaveStuff()
{
new coordsstring[128];
format(coordsstring, sizeof(coordsstring), "%d,%d,%d", Jackpot,Tax,TaxValue);
new File: file2 = fopen("Configs/stuff.ini", io_write);
fwrite(file2, coordsstring);
fclose(file2);
return 1;
}
pawn Код:
C:\DOCUME~1\PEUMEN~1\Desktop\SAMP03~1\GAMEMO~1\BTG.pwn(20194) : warning 219: local variable "file" shadows a variable at a preceding level
C:\DOCUME~1\PEUMEN~1\Desktop\SAMP03~1\GAMEMO~1\BTG.pwn(20198) : error 004: function "split" is not implemented
C:\DOCUME~1\PEUMEN~1\Desktop\SAMP03~1\GAMEMO~1\BTG.pwn(20211) : warning 219: local variable "file2" shadows a variable at a preceding level
Linha 20194
pawn Код:
new File: file = fopen("Configs/stuff.ini", io_read);
Linha 20198
pawn Код:
split(strFromFile2, arrCoords, ',');
Linha 20211
pawn Код:
new File: file2 = fopen("Configs/stuff.ini", io_write);
Re: [AJUDA] ERRO salvar, carregar -
peumenezes - 04.05.2012
galera eu fiz uns ajustes e os erros viraram warnnings
pawn Код:
C:\DOCUME~1\PEUMEN~1\Desktop\SAMP03~1\GAMEMO~1\BTG.pwn(20194) : warning 219: local variable "file" shadows a variable at a preceding level
C:\DOCUME~1\PEUMEN~1\Desktop\SAMP03~1\GAMEMO~1\BTG.pwn(20211) : warning 219: local variable "file2" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 5612 bytes
Code size: 878452 bytes
Data size: 944604 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 1845052 bytes
2 Warnings.
Re: [AJUDA] ERRO salvar, carregar -
WLSF - 04.05.2012
Shadow precending a level
pawn Код:
new File: file
//&&
new File: file2
й porque estбs variбveis jб existem, modifique-as.