stock SalvarConta(playerid)
{
new arquivo[50], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(arquivo, sizeof(arquivo), "BrazukaRPG/Contas/%s.txt", playername);
if(DOF2_FileExists(arquivo))
{
DOF2_SetInt(arquivo, "Admin", Info[playerid][zAdmin]);
DOF2_SetInt(arquivo, "Profissao", Profissao[playerid]);
Info[playerid][zLevel] = GetPlayerScore(playerid);
DOF2_SetInt(arquivo, "Level", Info[playerid][zLevel]);
DOF2_SetInt(arquivo, "Respeito", Info[playerid][zRespeito]);
Info[playerid][zDinheiro] = GetPlayerMoney(playerid);
DOF2_SetInt(arquivo, "Dinheiro", Info[playerid][zDinheiro]);
}
else
{
DOF2_CreateFile(arquivo);
DOF2_SetInt(arquivo, "Admin", Info[playerid][zAdmin]);
DOF2_SetInt(arquivo, "Profissao", Profissao[playerid]);
Info[playerid][zLevel] = GetPlayerScore(playerid);
DOF2_SetInt(arquivo, "Level", Info[playerid][zLevel]);
DOF2_SetInt(arquivo, "Respeito", Info[playerid][zRespeito]);
Info[playerid][zDinheiro] = GetPlayerMoney(playerid);
DOF2_SetInt(arquivo, "Dinheiro", Info[playerid][zDinheiro]);
}
return 1;
}
stock CarregarConta(playerid)
{
new arquivo[50], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(arquivo, sizeof(arquivo), "BrazukaRPG/Contas/%s.txt", playername);
Info[playerid][zAdmin] = DOF2_GetInt(arquivo, "Admin");
Info[playerid][zRespeito] = DOF2_GetInt(arquivo, "Respeito");
SetPlayerScore(playerid, GetPlayerScore(Info[playerid][zLevel]));
Info[playerid][zLevel] = DOF2_GetInt(arquivo, "Level");
Info[playerid][zDinheiro] = DOF2_GetInt(arquivo, "Dinheiro");
GivePlayerMoney(playerid, Info[playerid][zDinheiro]);
Profissao[playerid] = DOF2_GetInt(arquivo, "Profissao");
return 1;
}
stock SalvarConta(playerid)
{
new arquivo[50], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(arquivo, sizeof(arquivo), "BrazukaRPG/Contas/%s.txt", playername);
if(DOF2_FileExists(arquivo))
{
DOF2_SetInt(arquivo, "Admin", Info[playerid][zAdmin]);
DOF2_SetInt(arquivo, "Profissao", Profissao[playerid]);
DOF2_SetInt(String, "Score", GetPlayerScore(playerid));
DOF2_SetInt(arquivo, "Respeito", Info[playerid][zRespeito]);
Info[playerid][zDinheiro] = GetPlayerMoney(playerid);
DOF2_SetInt(arquivo, "Dinheiro", Info[playerid][zDinheiro]);
}
else
{
DOF2_CreateFile(arquivo);
DOF2_SetInt(arquivo, "Admin", Info[playerid][zAdmin]);
DOF2_SetInt(arquivo, "Profissao", Profissao[playerid]);
DOF2_SetInt(String, "Score", GetPlayerScore(playerid));
DOF2_SetInt(arquivo, "Respeito", Info[playerid][zRespeito]);
Info[playerid][zDinheiro] = GetPlayerMoney(playerid);
DOF2_SetInt(arquivo, "Dinheiro", Info[playerid][zDinheiro]);
}
return 1;
}
stock CarregarConta(playerid)
{
new arquivo[50], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(arquivo, sizeof(arquivo), "BrazukaRPG/Contas/%s.txt", playername);
Info[playerid][zAdmin] = DOF2_GetInt(arquivo, "Admin");
Info[playerid][zRespeito] = DOF2_GetInt(arquivo, "Respeito");
Info[playerid][pScore] = DOF2_GetInt(String, "Score");
Info[playerid][zDinheiro] = DOF2_GetInt(arquivo, "Dinheiro");
GivePlayerMoney(playerid, Info[playerid][zDinheiro]);
Profissao[playerid] = DOF2_GetInt(arquivo, "Profissao");
return 1;
}
|
Tenta ae
pawn Код:
|
Info[playerid][pScore] = DOF2_GetInt(String, "Score");
//OnPlayerUpdate
SetPlayerScore(playerid, Info[playerid][zLevel]);