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;
}
#define arquivo "Contas/%s.ini"
// -----
stock GetarConta(playerid)
{
new arq[40];
format(arq, sizeof(arq), arquivo, pName(playerid));
return arq;
}
public OnPlayerSpawn(playerid){
new arq[40];
format(arq, sizeof(arq), arquivo, pName(playerid));
SetPlayerSkin(playerid,DOF2_GetInt(arq,"Skin"));
return 1;
}
Eu tive o mesmo problema,vou te dar uma lуgica para vocк resolver,aн vocк arruma de acordo com o seu GM.
pawn Код:
|
Problema,nгo й setar a Skin quando o player da spawn..
O problema й que ele nгo salva a skin do player. Ela sempre retorna a 0 ( a skin do cj ) |
A conta dele em Scriptfiles marca a skin como 0.
Se eu mudar a skin dele no Scriptfiles,e ele logar,ele loga com a skin que eu coloquei lб,mas ao sair a skin sempre retorna a 0 |
public OnPlayerSpawn(playerid){
new arq[40],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(arq, sizeof(arq), arquivo, pName(playerid));
SetPlayerSkin(playerid,DOF2_GetInt(arq,"Skin"));
return 1;
}
Entгo mude novamente a skin em scriptfiles e use como base o meu cуdigo,vai da certo.
Edit:Esqueci de um detalhe importante que o schoc citou. pawn Код:
|
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;
}
stock GetarConta(playerid)
{
new arq[40];
format(arq, sizeof(arq), arquivo, pName(playerid));
return arq;
}