//================================== HElper=======================================//
enum Helper
{
HMembro[MAX_PLAYER_NAME],
HelpersVaga,
};
new HelperInfo[15][Helper];
forward HelpersCheck(playerid);
forward HelpersVaga();
public HelpCheck(playerid)
{
new idx = 0;
while(idx < sizeof(HelperInfo))
{
if(strcmp(HelperInfo[idx][HMembro],PlayerName(playerid), true ) == 0 )
{
return 1;
}
idx++;
}
return 0;
}
public HelpersVaga()
{
new storedcopname[64];
new File: file = fopen("Configs/Helpers.cfg", io_read);
if (file)
{
new valtmp[MAX_PLAYER_NAME];
while (fread(file, valtmp) > 0)
{
strmid(storedcopname, valtmp, 0, strlen("Vazio"), 255);
if ((strcmp(storedcopname, "Vazio", true, strlen("Vazio")) == 0) && (strlen("Vazio") == strlen(storedcopname)))
{
fclose(file);
VagaSobrando = 1;
return 1;
}
}
}
fclose(file);
VagaSobrando = 0;
return 0;
}
forward LoadHelpers();
forward SaveHelpers();
public SaveHelpers()
{
new idx;
new File: file2;
while (idx < sizeof(HelperInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%s,%d\n",HelperInfo[idx][HMembro],HelperInfo[idx][HelpersVaga]);
if(idx == 0)
{
file2 = fopen("Configs/Helpers.cfg", io_write);
}
else
{
file2 = fopen("Configs/Helpers.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}
public LoadHelpers()
{
new arrCoords[2][64];
new strFromFile2[256];
new File: file = fopen("Configs/Helpers.cfg", io_read);
if (file)
{
new idx = 0;
while(idx < sizeof(HelperInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
strmid(HelperInfo[idx][HMembro], arrCoords[0], 0, strlen(arrCoords[0]), 255);
HelperInfo[idx][HelpersVaga] = strval(arrCoords[1]);
idx++;
}
}
fclose(file);
return 1;
}
new HelperInfo[2][Helper];
new HelperInfo[15][Helper];
VagaSobrando += 1;
VagaSobrando = 1;
Coloque:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|
Troque HelpersVaga da enum por outra coisa, pois estб dando conflito!
Ou troque o nome da public. |
C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(1048) : error 076: syntax error in the expression, or invalid function call C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(1077) : error 076: syntax error in the expression, or invalid function call C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(18478) : warning 202: number of arguments does not match definition C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(38569) : error 037: invalid string (possibly non-terminated string) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
ai mano due mais ainda tem uns erros olha
Код:
C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(1048) : error 076: syntax error in the expression, or invalid function call C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(1077) : error 076: syntax error in the expression, or invalid function call C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(18478) : warning 202: number of arguments does not match definition C:\Documents and Settings\Administrador\Meus documentos\Meus arquivos recebidos\serve\gamemodes\TetaVeia.pwn(38569) : error 037: invalid string (possibly non-terminated string) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. |
public SaveHelpers()
{
new idx;
new File: file2;
while (idx < sizeof(HelperInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%s,%d\n",HelperInfo[idx][gMembro],HelperInfo[idx][HelpersVaga]);//1048 linha
if(idx == 0)
{
file2 = fopen("Configs/Helpers.cfg", io_write);
}
else
{
file2 = fopen("Configs/Helpers.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}