Boa noite. estou com um problema que aconteceu do nada.. la na conta do player esta salvo o dinheiro dele normalmente.. porém quando ele loga no servidor fica em 0000000 como se não tivesse dinheiro na conta..
codigo de salvamento
codigo de salvamento
Código PHP:
SalvandoConta(playerid)
{
if(PlayerInfo[playerid][pLogado] == true)
{
getdate(Datas[2], Datas[1], Datas[0]);
gettime(Datas[3], Datas[4],Datas[5]);
new string[128];
format(string,sizeof(string),"%02d:%02d:%02d - %d/%d/%d",Datas[3],Datas[4],Datas[5],Datas[0],Datas[1],Datas[2]);
DOF2_SetString(GetPlayerArquivo(playerid), "Ultimo Login",string);
GetPlayerHealth(playerid,PlayerInfo[playerid][vida]);
DOF2_SetInt(GetPlayerArquivo(playerid),"Level",PlayerInfo[playerid][Level],"ITENS");
DOF2_SetInt(GetPlayerArquivo(playerid),"Skin",GetPlayerSkin(playerid),"ITENS");
DOF2_SetInt(GetPlayerArquivo(playerid),"Money",GetPlayerMoneyEx(playerid),"ITENS");
DOF2_SetInt(GetPlayerArquivo(playerid),"Matou",PlayerInfo[playerid][Kills],"PVP");
DOF2_SetInt(GetPlayerArquivo(playerid),"Morreu",PlayerInfo[playerid][Death],"PVP");
DOF2_SetString(GetPlayerArquivo(playerid),"IP",Pegarip(playerid));
DOF2_SetInt(GetPlayerArquivo(playerid),"Admin",PlayerInfo[playerid][Admin]);
DOF2_SetInt(GetPlayerArquivo(playerid),"CargoZone",PlayerInfo[playerid][CargoZone]);
SavePresos(playerid);
SavePresosEstaduais(playerid);
DOF2_SaveFile();
}
}
Código PHP:
loadPlayerAccount(playerid) {
PlayerInfo[playerid][Level] = DOF2_GetInt(GetPlayerArquivo(playerid), "Level", "ITENS");
PlayerInfo[playerid][skin] = DOF2_GetInt(GetPlayerArquivo(playerid), "Skin", "ITENS");
PlayerInfo[playerid][money] = DOF2_GetInt(GetPlayerArquivo(playerid), "Money", "ITENS");
PlayerInfo[playerid][Kills] = DOF2_GetInt(GetPlayerArquivo(playerid), "Matou", "PVP");
PlayerInfo[playerid][Death] = DOF2_GetInt(GetPlayerArquivo(playerid), "Morreu", "PVP");
PlayerInfo[playerid][Admin] = DOF2_GetInt(GetPlayerArquivo(playerid), "Admin");
PlayerInfo[playerid][CargoZone] = DOF2_GetInt(GetPlayerArquivo(playerid), "CargoZone");
PlayerInfo[playerid][pEstrelas] = DOF2_GetInt(GetPlayerEstadual(playerid), "Stars");
PlayerInfo[playerid][Presoestadual] = DOF2_GetBool(GetPlayerEstadual(playerid), "presoq");
PlayerInfo[playerid][PresoN] = DOF2_GetInt(GetPlayerEstadual(playerid), "tempo");
PlayerInfo[playerid][pLogado] = true;
PlayerInfo[playerid][Stats] = DISPONIVEL;
PlayerInfo[playerid][preso] = DOF2_GetInt(GetPlayerPresos(playerid),"Preso") > 0;
setPlayerScoreEx(playerid, PlayerInfo[playerid][Level], true);
TimerHora[playerid] = SetTimerEx("HoraP", 60000 * 10, 1, "i", playerid); // 60000 * 60 seria multiplicar 1 minuto x 60 minutos = 1 hora
}
createPlayerAccount(playerid, password[]) {
new string[128];
getdate(Datas[2], Datas[1], Datas[0]);
gettime(Datas[3], Datas[4],Datas[5]);
DOF2_CreateFile(GetPlayerArquivo(playerid));
DOF2_SetString(GetPlayerArquivo(playerid), "Senha", password);
DOF2_SetInt(GetPlayerArquivo(playerid), "Level", 1, "ITENS");
DOF2_SetInt(GetPlayerArquivo(playerid), "Skin", 0, "ITENS");
DOF2_SetInt(GetPlayerArquivo(playerid), "Money", 5000, "ITENS");
DOF2_SetInt(GetPlayerArquivo(playerid), "Matou", 0, "PVP");
DOF2_SetInt(GetPlayerArquivo(playerid), "Morreu", 0, "PVP");
DOF2_SetString(GetPlayerArquivo(playerid), "IP", Pegarip(playerid));
DOF2_SetInt(GetPlayerArquivo(playerid), "Admin", 0);
DOF2_SetInt(GetPlayerArquivo(playerid), "CargoZone", 0);
DOF2_SetInt(GetPlayerEstadual(playerid), "Stars", 0);
DOF2_SetBool(GetPlayerEstadual(playerid), "presoq", false);
DOF2_SetInt(GetPlayerEstadual(playerid), "tempo", 0);
DOF2_SetInt(GetPlayerPresos(playerid), "Preso", 0);
format(string, sizeof(string),"%02d:%02d:%02d - %d/%d/%d", Datas[3],Datas[4],Datas[5],Datas[0],Datas[1],Datas[2]);
DOF2_SetString(GetPlayerArquivo(playerid), "Data de Registro", string);
SetPVarInt(playerid, "firstLogin", 1);
}
Código PHP:
GivePlayerMoneyEx(id, moneys) return PlayerInfo[id][money] += moneys;
GetPlayerMoneyEx(id) return PlayerInfo[id][money];
ResetPlayerMoneyEx(id) return PlayerInfo[id][money] = 0;