14.05.2012, 21:57
Tenta Ae
@Edit '-'
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();
}