SA-MP Forums Archive
[Ajuda] Erro bizonho no DOF2 (kkk) - 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 bizonho no DOF2 (kkk) (/showthread.php?tid=364697)



Erro bizonho no DOF2 (kkk) - [XPG]MarlonCS - 31.07.2012

Veja o cуdigo:

pawn Код:
CMD:mudarsenha(playerid, params[])
{
    if(admlevel[playerid] > 0) return SendClientMessage(playerid, vermelho, "[SERVER] Vocк й admin.");
    new asenha[MAX_PLAYERS], senha[MAX_PLAYERS], psenha[MAX_PLAYERS];
    if(sscanf(params, "ss",asenha[playerid], senha[playerid])) { return SendClientMessage(playerid, -1, "[SERVER] Uso: /mudarsenha [senha antiga] [nova senha]"); }
    else
    {
        format(arquivo, sizeof arquivo, "/infos/%s.ini", pnome(playerid));
        psenha[playerid] = DOF2_GetString(arquivo, "Senha");
        if(asenha[playerid] == psenha[playerid]) {
            DOF2_SetString(arquivo, "Senha",senha[playerid]);
            DOF2_SaveFile();
            format(string, sizeof string, "[SERVER] Sua senha foi mudada para '%s' com sucesso!", senha[playerid]);
            SendClientMessage(playerid, verde, string);
        }else SendClientMessage(playerid, vermelho, "[SERVER] Senha antiga incorreta, tente novamente");
    }
    return 1;
}
Tб dando erro nessa linha: psenha[playerid] = DOF2_GetString(arquivo, "Senha");

Erro: error 006: must be assigned to an array


Re: Erro bizonho no DOF2 (kkk) - paulor - 31.07.2012

DOF2_GetString(arquivo, "Senha"); - Retorna STRING.
DOF2_GetInt(arquivo, "Senha"); - Retorna INT.


Entгo o erro bizonho й seu e nгo do DOF2.

@Edit

Totalmente desnecessбrios: new asenha[MAX_PLAYERS], senha[MAX_PLAYERS], psenha[MAX_PLAYERS];


Re: Erro bizonho no DOF2 (kkk) - Dolby - 31.07.2012

Tem certeza que declarou psenha[playerid] uma variбvel do tipo String ?


Re: Erro bizonho no DOF2 (kkk) - [XPG]MarlonCS - 31.07.2012

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
Tem certeza que declarou psenha[playerid] uma variбvel do tipo String ?
como descubro isso? ._.


Re: Erro bizonho no DOF2 (kkk) - paulor - 31.07.2012

Se era para ser String e nгo numйrico vc errou em bastante coisas...


Re: Erro bizonho no DOF2 (kkk) - humildadeforever - 31.07.2012

pawn Код:
CMD:mudarsenha(playerid, params[])
{
    new asenha[20],nsenha[20];
    if(sscanf(params,"ss", asenha, nsenha)) return SendClientMessage(playerid,-1,"Use: /mudarsenha [Antiga Senha] [Nova Senha]");
    format(arquivo, sizeof arquivo, "/infos/%s.ini", pnome(playerid));
    if(strcmp(DOF2_GetString(arquivo,"Senha"),asenha, false) == 0)
   {
        DOF2_SetString(arquivo,"Senha", nsenha);
        DOF2_SaveFile();
        SendClientMessage(playerid,-1,"Senha alterada com sucesso!");
   }
   else SendClientMessage(playerid,-1,"Senha incorreta.");
   return 1;
}



Re: Erro bizonho no DOF2 (kkk) - [Ips]Guh - 31.07.2012

Quote:
Originally Posted by [XPG]MarlonCS
Посмотреть сообщение
como descubro isso? ._.
Poste a enum que vocк definiu isso ai...


Re: Erro bizonho no DOF2 (kkk) - Mito_FmZ - 31.07.2012

Amigo criei uma dъvida igualzinha a essa, venha o post "Erros DOF2" use a busca, eu que criei o post deve estar entre os ъltimos post. Use a busca =]


Re: Erro bizonho no DOF2 (kkk) - [XPG]MarlonCS - 31.07.2012

Quote:
Originally Posted by humildadeforever
Посмотреть сообщение
pawn Код:
CMD:mudarsenha(playerid, params[])
{
    new asenha[20],nsenha[20];
    if(sscanf(params,"ss", asenha, nsenha)) return SendClientMessage(playerid,-1,"Use: /mudarsenha [Antiga Senha] [Nova Senha]");
    format(arquivo, sizeof arquivo, "/infos/%s.ini", pnome(playerid));
    if(strcmp(DOF2_GetString(arquivo,"Senha"),asenha, false) == 0)
   {
        DOF2_SetString(arquivo,"Senha", nsenha);
        DOF2_SaveFile();
        SendClientMessage(playerid,-1,"Senha alterada com sucesso!");
   }
   else SendClientMessage(playerid,-1,"Senha incorreta.");
   return 1;
}
funcionou, vlw

Valeu para quem tentou ajudar tbm