[AJUDA] DOF2 Nгo estб salvando -
Chis - 14.05.2012
Eu to comeзando a mexer com o dof2 agora e nгo conheзo muito bem, e nгo to conseguindo salvar o player quando disconnecta do servidor e nгo consegui resolver.
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
SalvarConta(playerid);
return 1;
}
public OnGameModeExit()
{
DOF2_Exit();
return 1;
}
SalvarConta(playerid)
{
new file[64];
new Float:Vida, Float:Colete;
GetPlayerHealth(playerid, Vida);
GetPlayerArmour(playerid, Colete);
format(file, sizeof(file), d_CONTAS, PlayerInfo[playerid][Nome]);
DOF2_SetInt(file, "Assassinatos",PlayerInfo[playerid][Assassinatos]);
DOF2_SetInt(file, "Mortes",PlayerInfo[playerid][Mortes]);
DOF2_SetInt(file, "Dinheiro",PlayerInfo[playerid][Dinheiro]);
DOF2_SetInt(file, "AdminLevel",PlayerInfo[playerid][Admin]);
DOF2_SetFloat(file, "Vida",Vida);
DOF2_SetFloat(file, "Colete",Colete);
return 1;
}
Re: [AJUDA] DOF2 Nгo estб salvando -
Lуs - 14.05.2012
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
SalvarConta(playerid);
return 1;
}
public OnGameModeExit()
{
DOF2_Exit();
return 1;
}
SalvarConta(playerid)
{
new file[64];
new Float:Vida, Float:Colete;
GetPlayerHealth(playerid, Vida);
GetPlayerArmour(playerid, Colete);
format(file, sizeof(file), d_CONTAS, PlayerInfo[playerid][Nome]);
DOF2_SetInt(file, "Assassinatos",PlayerInfo[playerid][Assassinatos]);
DOF2_SetInt(file, "Mortes",PlayerInfo[playerid][Mortes]);
DOF2_SetInt(file, "Dinheiro",PlayerInfo[playerid][Dinheiro]);
DOF2_SetInt(file, "AdminLevel",PlayerInfo[playerid][Admin]);
DOF2_SetFloat(file, "Vida",Vida);
DOF2_SetFloat(file, "Colete",Colete);
return DOF2_SaveFile();
}
Abraзos.
Respuesta: [AJUDA] DOF2 Nгo estб salvando -
Chis - 14.05.2012
continua nгo salvando =/
Fica assim no .ini
password = 67371303
Assassinatos = 0
Mortes = 0
Dinheiro = 1000
AdminLevel = 0
Eu dou adm mais continua no 0 a vida й a mesma coisa fica no 0
@EDIT:
https://sampforum.blast.hk/showthread.php?tid=281736
Re: [AJUDA] DOF2 Nгo estб salvando -
mau.tito - 14.05.2012
Tenta Ae
pawn Code:
#define MAXIMO_VIDA 100
#define MAXIMO_COLETE 100
enum pInfo {
pAssassinatos
pMortes
pDinheiro
pAdmin
};
new PlayerInfo[MAX_PLAYERS][pInfo];
public OnPlayerDisconnect(playerid, reason)
{
SalvarConta(playerid);
return 1;
}
public OnGameModeExit()
{
DOF2_Exit();
return 1;
}
SalvarConta(playerid)
{
new file[64];
new Float:Vida, Float:Colete;
GetPlayerHealth(playerid, Vida);
GetPlayerArmour(playerid, Colete);
format(file, sizeof(file), d_CONTAS, PlayerInfo[playerid][pNome]);
DOF2_SetInt(file, "Assassinatos",PlayerInfo[playerid][pAssassinatos]);
DOF2_SetInt(file, "Mortes",PlayerInfo[playerid][pMortes]);
DOF2_SetInt(file, "Dinheiro",PlayerInfo[playerid][pDinheiro]);
DOF2_SetInt(file, "AdminLevel",PlayerInfo[playerid][pAdmin]);
DOF2_SetFloat(file, "Vida",MAXIMO_VIDA);
DOF2_SetFloat(file, "Colete",MAXIMO_COLETE);
return DOF2_SaveFile();
}
@Edit '-'
Respuesta: [AJUDA] DOF2 Nгo estб salvando -
Chis - 14.05.2012
A vida й de menos, nem dinheiro nem adminlevel ta salvando, tinha colocado o vida sу pra testar
Re: [AJUDA] DOF2 Nгo estб salvando -
ViictorDaay- - 14.05.2012
No lugar de 'Dinheiro' num e money nгo? ou й do seu gamemode
mesma coisa no admin pode ser pAdmin
Re: [AJUDA] DOF2 Nгo estб salvando -
paulor - 14.05.2012
este 'd_CONTAS' estб correto ?
Respuesta: [AJUDA] DOF2 Nгo estб salvando -
Chis - 14.05.2012
pawn Code:
#define d_CONTAS "/contas/%s.ini"
Re: [AJUDA] DOF2 Nгo estб salvando -
Joker_OutLock - 14.05.2012
pawn Code:
#define d_CONTAS "contas/%s.ini"
tente agora.
Re: [AJUDA] DOF2 Nгo estб salvando -
paulor - 14.05.2012
Quote:
Originally Posted by Joker_OutLock
pawn Code:
#define d_CONTAS "contas/%s.ini"
tente agora.
|
Nada haver isso! Manolo tenta fazer um debug pra descobrir...