SA-MP Forums Archive
[Ajuda] Oque Tem De Errado? - 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] Oque Tem De Errado? (/showthread.php?tid=382331)



Oque Tem De Errado? - Owtsiixx_Twd - 02.10.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME);
    if (fexist(ObterINI(playerid)))
    {
        ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD,""BRANCO"Login",""VERDE"                   Bem Vindo Novamente\n Digite Sua "VERMELHO"Senha Abaixo Para"VERDE" Efetuar Login!.","Logar","Sair");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTRO,DIALOG_STYLE_PASSWORD,""BRANCO"Registrando",""VERDE""VERMELHO"Digite Sua Senha Abaixo"VERDE" Para Registrar Uma Nova Conta.","Registrar","Sair");
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTRO:
        {
            if (!response) return Kick(playerid);
            if (response)
            {
                if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, ""BRANCO"Registrando...",""VERMELHO"Vocк Digitou Uma "VERDE"Senha Invбlida.\n"BRANCO"Digite Sua Senha Abaixo Para Registrar Uma Nova Conta.","Registrar","Sair");
                }

                if(INI_Open(ObterINI(playerid))) {
                INI_WriteString("Senha",inputtext);
                INI_WriteInt("Score",1);
                INI_WriteInt("Dinheiro",5000);
                INI_WriteInt("Admin",0);

                INI_Save();
                INI_Close();

                ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD,""BRANCO"Logar",""BRANCO"Digite sua "VERMELHO"Senha "VERDE" abaixo para efetuar login.","Logar","Sair");
            }
        }
    }
        case DIALOG_LOGAR:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, ""BRANCO"Logar",""VERMELHO"Vocк digitou uma "VERMELHO"Senha invбlida.\n"VERDE"Digite sua "VERDE"senha abaixo para efetuar login.","Logar","Quit");
                }

                if(INI_Open(ObterINI(playerid))) {
                INI_ReadString(PlayerInfo[playerid][pSenha],"Senha",20);

                if(strcmp(inputtext,PlayerInfo[playerid][pSenha],false)) {
                ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, ""BRANCO"Logar",""VERMELHO"Vocк digitou uma "VERMELHO"Senha incorreta.\n"VERDE"Digite sua senha abaixo para acessar.","Logar","Sair");
                }

                SetPlayerScore( playerid, INI_ReadInt("Score" ) );
                ResetPlayerMoney( playerid );
                GivePlayerMoney( playerid, INI_ReadInt( "Dinheiro" ) );
                PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
                INI_Close();
                }
            }
        }
    }
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    if(INI_Open(ObterINI(playerid))) {

    INI_WriteInt("Score",PlayerInfo[playerid][pScore]);
    INI_WriteInt("Dinheiro",GetPlayerMoney(playerid));
    INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);

    INI_Save();
    INI_Close();
    }
    return 1;
}
// final do gm
stock ObterINI(playerid)
{
  new conta[64];
  format(conta,30,"Contas/%s.ini",gPlayerName[playerid]);
  return conta;
}
O problema й que fecha o samp-server na hora de executar pq iso?
OBS: tenho a pasta criada


Re: Oque Tem De Errado? - Owtsiixx_Twd - 02.10.2012

@edit Resolvido Jб