Erro no salvamento de senha (null) -
yurin - 03.12.2016
Senha estб sendo salva como (null) quando se desconecta do server
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
if(Logado{playerid} == true) SalvarContas(playerid);
Logado{playerid} = false;
return 1;
}
PHP код:
stock SalvarContas(playerid)
{
DOF2_SetString(Contas(playerid), "Senha", pDados[playerid][Senha]);
DOF2_SetInt(Contas(playerid), "Matou", pDados[playerid][Matou]);
DOF2_SetInt(Contas(playerid), "Morreu", pDados[playerid][Morreu]);
DOF2_SetInt(Contas(playerid), "Dolar", pDados[playerid][Dolar]);
DOF2_SetInt(Contas(playerid), "Real", pDados[playerid][Real]);
DOF2_SetInt(Contas(playerid), "Sexo", pDados[playerid][Sexo]);
DOF2_SetInt(Contas(playerid), "Skin", pDados[playerid][Skin]);
DOF2_SetInt(Contas(playerid), "Vida", pDados[playerid][Vida]);
DOF2_SetInt(Contas(playerid), "Colete", pDados[playerid][Colete]);
DOF2_SetInt(Contas(playerid), "Level", pDados[playerid][Level]);
DOF2_SetInt(Contas(playerid), "Staff", pDados[playerid][Staff]);
DOF2_SetInt(Contas(playerid), "VIP", pDados[playerid][VIP]);
DOF2_SetInt(Contas(playerid), "Banco", pDados[playerid][Banco]);
DOF2_SaveFile();
return 1;
}
Re: Erro no salvamento de senha (null) -
[BOPE]Seu._.Madruga - 03.12.2016
Salvando a senha:
PHP код:
pDados[playerid][Senha] = strval(inputtext);
Na hora de logar:
PHP код:
pDados[playerid][Senha] = DOF2_GetInt(Contas(playerid), "Senha"); //Pega a senha do jogador no arquivo da conta
if(strval(inputtext) == pDados[playerid][Senha])
Re: Erro no salvamento de senha (null) -
yurin - 03.12.2016
No caso de eu usar hash padrгo, mudaria algo? E tipo eu vejo que salva tudo certo logo apos o registro, porem quando sai do jogo que fica a senha salva como (null)
Re: Erro no salvamento de senha (null) -
[BOPE]Seu._.Madruga - 03.12.2016
Me mostra como estб salvando no registro e como estб salvando quando sai do jogo.
Obs: nгo tem o porque ficar salvando a senha toda vez que sair do jogo correto?!
Re: Erro no salvamento de senha (null) -
yurin - 03.12.2016
Mano namoral, to de saco cheio de min mesmo, eu sou burro de mais todos erros que estou fazendo й erro bбsico, tu й um deus, tu tava certo, pra que eu salvar a senha toda vez que o cara desloga, entгo simplesmente tirei e pronto resolveu! Queria ti da rep, mas sou novato e nгo consigo dar rep por algum motivo por que antes eu conseguia
EDIT: Consegui da rep
Re: Erro no salvamento de senha (null) -
yurin - 03.12.2016
Antes tenho outra duvida, minha textdraw de dinheiro sempre que muda o numero ela sу adiciona outra textdraw por cima, ai o numero antigo fica atras, sabe oque fazer?
PHP код:
public Dinheiro()
{
new str[128];
new playerid;
format(str, 256, "~g~R$%d", GetPlayerReal(playerid));
Grana = TextDrawCreate(497.000000, 118.000000,str);
TextDrawBackgroundColor(Grana, 255);
TextDrawFont(Grana, 3);
TextDrawLetterSize(Grana, 0.509999, 2.100000);
TextDrawColor(Grana, -1);
TextDrawSetOutline(Grana, 1);
TextDrawSetProportional(Grana, 0);
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawHideForPlayer(i, Grana);
TextDrawShowForPlayer(i, Grana);
}
}
return 1;
}
Re: Erro no salvamento de senha (null) -
[BOPE]Seu._.Madruga - 04.12.2016
Troque GetPlayerMoney por sua variбvel que tem funзгo de obter o dinheiro do player.
PHP код:
new Text:txtMoney[MAX_PLAYERS];
forward Dinheiro();
public OnGameModeInit() {
for(new i; i < MAX_PLAYERS; i ++)
{
txtMoney[i] = TextDrawCreate(497.000000, 118.000000, "~g~~h~R$: ~w~~h~0");
TextDrawBackgroundColor(txtMoney[i], 255);
TextDrawFont(txtMoney[i], 3);
TextDrawLetterSize(txtMoney[i], 0.509999, 2.100000);
TextDrawColor(txtMoney[i], -1);
TextDrawSetOutline(txtMoney[i], 1);
TextDrawSetProportional(txtMoney[i], 0);
}
SetTimer("Dinheiro", 5000, true);
return 1;
}
public Dinheiro()
{
new str[128];
for(new i; i < MAX_PLAYERS; i ++)
{
TextDrawHideForPlayer(i, txtMoney[i]);
if(IsPlayerConnected(i))
{
format(str, 256, "~g~~h~R$: ~w~%d", GetPlayerMoney(i));
TextDrawShowForPlayer(i, txtMoney[i]);
}
}
return 1;
}