[AJUDA] ERRO salvar, carregar
#1

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);
Reply
#2

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

Shadow precending a level
pawn Код:
new File: file
//&&
new File: file2
й porque estбs variбveis jб existem, modifique-as.

pawn Код:
new File: _file
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)