20/07/2023 19:17
(20/07/2023 17:07)Sr_Nublein Escreveu: ah ta aque ta o meu codigo
Código:enum pinfo
{
Dinheiro,
Score,
Skin
}
new info[MAX_PLAYERS][pinfo];
stock SalvarDados(playerid)
{
new File[250];
format(File, sizeof(File), "Contas/%s.ini", pName(playerid));
if(DOF2_FileExists(File))
{
DOF2_SetInt(File, "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(File, "Score", GetPlayerScore(playerid));
DOF2_SetInt(File, "Skin", GetPlayerSkin(playerid));
DOF2_SaveFile();
}
{
DOF2_SetInt(File, "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(File, "Score", GetPlayerScore(playerid));
DOF2_SetInt(File, "Skin", GetPlayerSkin(playerid));
DOF2_CreateFile(File);
}
return 1;
}
stock CarregarDados(playerid)
{
new File[250];
format(File, sizeof(File), "Contas/%s.ini", pName(playerid));
if(DOF2_FileExists(File))
{
info[playerid][Dinheiro] = DOF2_GetInt(File, "Dinheiro");
GivePlayerMoney(playerid, info[playerid][Dinheiro]);
info[playerid][Score] = DOF2_GetInt(File, "Score");
SetPlayerScore(playerid, info[playerid][Score]);
info[playerid][Skin] = DOF2_GetInt(File, "Skin");
SetPlayerSkin(playerid, info[playerid][Skin]);
}
return 1;
} else
Tente assim
Código:
stock CarregarDados(playerid)
{
new File[250];
format(File, sizeof(File), "Contas/%s.ini", pName(playerid));
if(DOF2_FileExists(File))
{
info[playerid][Dinheiro] = DOF2_GetInt(File, "Dinheiro");
GivePlayerMoney(playerid, info[playerid][Dinheiro]);
info[playerid][Score] = DOF2_GetInt(File, "Score");
SetPlayerScore(playerid, info[playerid][Score]);
info[playerid][Skin] = DOF2_GetInt(File, "Skin");
SetPlayerSkin(playerid, DOF2_GetInt(File, "Skin"));
}
return 1;
}