SA-MP Forums Archive
[Ajuda] Registro - 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] Registro (/showthread.php?tid=393792)



Registro - Nice-.- - 19.11.2012

Bom primeiramente boa noite a todos da forum samp

й o seguinte ele registra e tudo mais tipo se eu digito a senha errada loga a mesma coisa ;(

olha oque eu tava tentando fazer

pawn Код:
public OnPlayerConnect(playerid)
{
    new Name[24], arquivo[60], string[200], string2[200];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(arquivo, sizeof(arquivo), "Contas/%s.jh", Name);
    format(string, sizeof(string), "Olб %s bem vindo ao SERVER [ DM ]\n vocк  й registrado\nDigite sua senha para se logar! ", Name);
    format(string2, sizeof(string2), "Olб %s bem vindo ao SERVER [ DM ]\nVocк ainda nгo й registrado\nPor favor digite uma senha para se registrar", Name);
    if(DOF2_FileExists(arquivo))
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "LOGIN:", string, "Logar-se", "Cancelar");
    }
    else
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD,  "REGISTRO:", string2, "Registrar", "Cancelar");
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new Name[24], arquivo[60], string[200], string2[200];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(arquivo, sizeof(arquivo), "Contas/%s.jh", Name);
    if(dialogid == DIALOG_REGISTER)
    {
        if(!response) return Kick(playerid);
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD,  "REGISTRO:", string2, "Registrar", "Cancelar");
        DOF2_CreateFile(arquivo, inputtext);
        DOF2_SetInt(arquivo, "Admin", 0);
        DOF2_SetInt(arquivo, "Matou", 0);
        DOF2_SetInt(arquivo, "Morreu", 0);
        DOF2_SetInt(arquivo, "Dinheiro", 1000);
        SpawnPlayer(playerid);
        DOF2_SaveFile();
    }
    if(dialogid == DIALOG_LOGIN)
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "LOGIN:", string, "Logar-se", "Cancelar");
        if(DOF2_FileExists(arquivo))
    {
        if(DOF2_CheckLogin(arquivo,inputtext))
        Juninho[playerid][pAdmin] = DOF2_GetInt(arquivo, "Admin");
        Juninho[playerid][Morreu] = DOF2_GetInt(arquivo, "Morreu");
        Juninho[playerid][Matou] =  DOF2_GetInt(arquivo, "Matou");
        GivePlayerMoney(playerid, Juninho[playerid][Dinheiro]);
    }
        else
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "LOGIN:", "SERVER [ DM ]\nVocк errou a senha tente novamente", "Logar-se", "Cancelar");
    }
        return 1;
  }
}



Re: Registro - Nice-.- - 19.11.2012

UP ? alguem ?


Re: Registro - jpeg - 19.11.2012

Isso aн nгo salva senha nenhuma. /=


Re: Registro - Nice-.- - 19.11.2012

Quote:
Originally Posted by jpeg
Посмотреть сообщение
Isso aн nгo salva senha nenhuma. /=
puta que pariu sу ta salvando o DINHEIRO AF PQP DESISTO DE FAZER SAPOHA NAMORAL


Re: Registro - Coreia - 19.11.2012

Poe no lugar de registro esse cod

pawn Код:
DOF2_SetString(arquivo,"Password",inputtext);
ai depois no sistema de login e so tu usar

pawn Код:
DOF2_GetString(arquivo,"Password");
Compila e testб para ver grato..