SA-MP Forums Archive
[Ajuda] Error no Salvar Contas - 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] Error no Salvar Contas (/showthread.php?tid=532829)



Error no Salvar Contas - eNtinityGaming - 20.08.2014

pawn Код:
C:\Documents and Settings\Vini\Desktop\Vinicius\Left 4 Dead 2\gamemodes\L4D2.pwn(1281) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Vini\Desktop\Vinicius\Left 4 Dead 2\gamemodes\L4D2.pwn(1281) : warning 215: expression has no effect
C:\Documents and Settings\Vini\Desktop\Vinicius\Left 4 Dead 2\gamemodes\L4D2.pwn(1281) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Vini\Desktop\Vinicius\Left 4 Dead 2\gamemodes\L4D2.pwn(1281) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Vini\Desktop\Vinicius\Left 4 Dead 2\gamemodes\L4D2.pwn(1281) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
pawn Код:
stock SalvarContas(playerid)
{
    new name[MAX_PLAYER_NAME];
    new arquivo[40];
    GetPlayerName(playerid, name, 32);
    format(arquivo, sizeof(arquivo), PASTA_CONTAS, name);
    if(!DOF2_FileExists(arquivo(playerid))) DOF2_CreateFile(arquivo(playerid)); // Linha 1281
    else
    {
        PlayerInfo[playerid][Dinheiro] = GetPlayerMoney(playerid);
        DOF2_SetInt(arquivo, "Senha", PlayerInfo[playerid][Senha]);
        DOF2_SetInt(arquivo, "Skin", PlayerInfo[playerid][Skin]);
        DOF2_SetInt(arquivo, "Idade", PlayerInfo[playerid][Idade]);
        DOF2_SetInt(arquivo, "Admin", PlayerInfo[playerid][Admin]);
        DOF2_SetInt(arquivo, "Sexo", PlayerInfo[playerid][Sexo]);
        DOF2_SetInt(arquivo, "Dinheiro", PlayerInfo[playerid][Dinheiro]);
        DOF2_SetInt(arquivo, "LaternaOn", PlayerInfo[playerid][LanternaOn]);
        DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][Level]);
        DOF2_SaveFile();
    }
    return 1;
}



Re: Error no Salvar Contas - Schocc - 20.08.2014

erro da estrutura condicional.

pawn Код:
stock SalvarContas(playerid)
{
    new name[MAX_PLAYER_NAME];
    new arquivo[40];
    GetPlayerName(playerid, name, 32);

    format(arquivo, sizeof(arquivo), "contas/leandro.ini", name);

    if(!DOF2_FileExists(arquivo))
        DOF2_CreateFile(arquivo);
   
    PlayerInfo[playerid][Dinheiro] = GetPlayerMoney(playerid);
    DOF2_SetInt(arquivo, "Senha", PlayerInfo[playerid][Senha]);
    DOF2_SetInt(arquivo, "Skin", PlayerInfo[playerid][Skin]);
    DOF2_SetInt(arquivo, "Idade", PlayerInfo[playerid][Idade]);
    DOF2_SetInt(arquivo, "Admin", PlayerInfo[playerid][Admin]);
    DOF2_SetInt(arquivo, "Sexo", PlayerInfo[playerid][Sexo]);
    DOF2_SetInt(arquivo, "Dinheiro", PlayerInfo[playerid][Dinheiro]);
    DOF2_SetInt(arquivo, "LaternaOn", PlayerInfo[playerid][LanternaOn]);
    DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][Level]);
    DOF2_SaveFile();
   
    return 1;
}



Re: Error no Salvar Contas - eNtinityGaming - 20.08.2014

Continua o erro


Re: Error no Salvar Contas - Schocc - 20.08.2014

Quote:
Originally Posted by eNtinityGaming
Посмотреть сообщение
Continua o erro
pawn Код:
stock SalvarContas(playerid)
{
    new name[MAX_PLAYER_NAME];
    new arquivo[40];
    GetPlayerName(playerid, name, sizeof(name));

    format(arquivo, sizeof(arquivo), PASTA_CONTAS, name);

    if(!DOF2_FileExists(arquivo))
        DOF2_CreateFile(arquivo);
   
    PlayerInfo[playerid][Dinheiro] = GetPlayerMoney(playerid);
    DOF2_SetInt(arquivo, "Senha", PlayerInfo[playerid][Senha]);
    DOF2_SetInt(arquivo, "Skin", PlayerInfo[playerid][Skin]);
    DOF2_SetInt(arquivo, "Idade", PlayerInfo[playerid][Idade]);
    DOF2_SetInt(arquivo, "Admin", PlayerInfo[playerid][Admin]);
    DOF2_SetInt(arquivo, "Sexo", PlayerInfo[playerid][Sexo]);
    DOF2_SetInt(arquivo, "Dinheiro", PlayerInfo[playerid][Dinheiro]);
    DOF2_SetInt(arquivo, "LaternaOn", PlayerInfo[playerid][LanternaOn]);
    DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][Level]);
    DOF2_SaveFile();
   
    return 1;
}



Re: Error no Salvar Contas - PT - 20.08.2014

pawn Код:
stock SalvarContas(playerid)
{
    new name[MAX_PLAYER_NAME], arquivo[40];
   
    format(arquivo, sizeof(arquivo), PASTA_CONTAS, (GetPlayerName(playerid, name, MAX_PLAYER_NAME), name));
    if(!DOF2_FileExists(arquivo))
        DOF2_CreateFile(arquivo);
   
    PlayerInfo[playerid][Dinheiro] = GetPlayerMoney(playerid);
    DOF2_SetInt(arquivo, "Senha", PlayerInfo[playerid][Senha]);
    DOF2_SetInt(arquivo, "Skin", PlayerInfo[playerid][Skin]);
    DOF2_SetInt(arquivo, "Idade", PlayerInfo[playerid][Idade]);
    DOF2_SetInt(arquivo, "Admin", PlayerInfo[playerid][Admin]);
    DOF2_SetInt(arquivo, "Sexo", PlayerInfo[playerid][Sexo]);
    DOF2_SetInt(arquivo, "Dinheiro", PlayerInfo[playerid][Dinheiro]);
    DOF2_SetInt(arquivo, "LaternaOn", PlayerInfo[playerid][LanternaOn]);
    DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][Level]);
    DOF2_SaveFile();
    return 1;
}
a variavel 'arquivo' n pode conter o parametro playerid

@ edit mals, demasiado lag aqui, ta uma porcaria este velho PC