[Ajuda] Salvamento DOF2.
#1

Olб caros amigos do forum sa-mp.

estou enfrentando um problema e nгo consigo localiza-lo em meu cуdigo. acontece que o sistema de salvamento que eu fiz a algum tempo atraz nгo estб funcionando corretamente... veja o cуdigo a seguir:

OnPlayerDisconnect

Code:
SalvarContas(playerid);
OnGameModeExit
Code:
for(new i = 0; i <= MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(Logado[i] == 1)
			{
				SalvarContas(i);
            }
        }
    }
Em On‌DialogResponse = DIALOG_REGISTRO

Code:
            new String[80];
			format(String, sizeof(String), CONTAS, Nome(playerid));
			DOF2_CreateFile(String);
			DOF2_SetString(String,"Senha", inputtext);
                 	DOF2_SetInt(String,"Matou", PlayerInfo[playerid][Matou]);
            DOF2_SetInt(String,"Morreu", PlayerInfo[playerid][Morreu]);
            DOF2_SetInt(String,"Dinheiro", GetPlayerMoney(playerid));
     		DOF2_SaveFile();
Em DIALOG_LOGIN

Code:
SetarConta(playerid);
Stocks de Salvamento.
SalvarContas(playerid) {
Code:
    new String[54];
	format(String, sizeof(String), CONTAS, Nome(playerid));
    DOF2_SetInt(String,"Matou", PlayerInfo[playerid][Matou]);
    DOF2_SetInt(String,"Morreu", PlayerInfo[playerid][Morreu]);
    DOF2_SetInt(String,"Dinheiro", GetPlayerMoney(playerid));
    DOF2_SaveFile();
    return 1;
}

SetarConta(playerid) {
    new String[54];
	format(String, sizeof(String), CONTAS, Nome(playerid));
    GivePlayerMoney(playerid, DOF2_GetInt(String,"Dinheiro"));
    PlayerInfo[playerid][Matou] = DOF2_GetInt(String, "Morreu");
    PlayerInfo[playerid][Morreu] = DOF2_GetInt(String, "Matou");
    return 1;
}
Viu? nгo estб salvando, nгo consigo identificar o erro.
Reply
#2

Qual a sua define para a variбvel CONTAS ?
Reply
#3

mostra como vc tem a define CONTAS
Reply
#4

Aqui:
pawn Code:
#define CONTAS                          "HW/Contas/%s.ini"
Reply
#5

Quando for ao PC te coloco o cуdigo direito e funcional.
Reply
#6

vc tem a pasta Contas criada?

lembra pawn e case sensitive.
Reply
#7

a pasta estб criada sim.
Reply
#8

Ninguem?
Reply
#9

Em qual parte ele nгo estб salvando?

OnPlayerDisconnect ou OnGameModeExit?
Reply
#10

Em nenhuma..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)