31.05.2013, 04:12
pawn Код:
#define arquivo "Contas/%s.ini"
// -----
stock GetarConta(playerid)
{
new arq[40];
format(arq, sizeof(arq), arquivo, pName(playerid));
return arq;
}
stock SalvarConta(playerid)
{
DOF2_SetInt(GetarConta(playerid), "AdmLevel", pDados[playerid][Admin]);
DOF2_SetInt(GetarConta(playerid), "Score", GetPlayerScore(playerid));
DOF2_SetInt(GetarConta(playerid), "Skin", GetPlayerSkin(playerid));
DOF2_SetInt(GetarConta(playerid), "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetBool(GetarConta(playerid), "Cadastro", pDados[playerid][Cadastrado]);
DOF2_SaveFile();
return 1;
}
stock CarregarConta(playerid)
{
pDados[playerid][Admin] = DOF2_GetInt(GetarConta(playerid), "AdmLevel");
SetPlayerScore(playerid, DOF2_GetInt(GetarConta(playerid), "Score"));
GivePlayerMoney(playerid, DOF2_GetInt(GetarConta(playerid), "Dinheiro"));
SetPlayerSkin(playerid,DOF2_GetInt(GetarConta(playerid),"Skin"));
return 1;
}