19.11.2012, 19:57
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
й 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;
}
}


?
