21.05.2017, 19:29
PHP код:
enum DadosP
{
Dinheiro,
Score
};
new Conta[MAX_PLAYERS][DadosP];
//OnPlayerDisconect
new file[80];
format(file,80, "Contas/%s.ini", PlayerName(playerid));
DOF2_SetInt(file, "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(file, "Score", GetPlayerScore(playerid));
DOF2_SaveFile();
// OnPlayerConnect
new file[80];
format(file,80, "Contas/%s.ini", PlayerName(playerid));
Conta[playerid][Dinheiro] = DOF2_GetInt(file,"Dinheiro");
Conta[playerid][Score] = DOF2_GetInt(file,"Score");
GivePlayerMoney(playerid, Conta[playerid][Dinheiro]),SetPlayerScore(playerid, GetPlayerScore(playerid)+Conta[playerid][Score]);