14.02.2013, 16:43
(
Последний раз редактировалось Coringa_Vilao; 07.11.2015 в 02:39.
)
Resolvido !
DOF2_SetInt(String,"Dinheiro", GetPlayerMoney(playerid));
GivePlayerMoney(playerid, DOF2_GetInt(String,"Dinheiro"));
//======= TOPO DO GM =========//
#define PASTA "Contas/%s.ini"
//========= OnPlayerConnect =========//
CarregarPlayer(playerid);
//========== OnPlayerDisconnect =========//
SalvarPlayer(playerid);
//======== FINAL ========//
stock SalvarPlayer(playerid)
{
if(DOF2_FileExists(Otario(playerid)))
{
DOF2_SetInt(Otario(playerid),"Dinheiro",GetPlayerMoney(playerid));
DOF2_SaveFile();
}
}
stock CarregarPlayer(playerid)
{
if(DOF2_FileExists(Otario(playerid)))
{
SetPlayerMoney(playerid, DOF2_GetInt(Otario(playerid), "Dinheiro"));
}
}
stock Otario(playerid)
{
new File[156],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(File,sizeof(File),PASTA,Name);
return File;
}
stock SetPlayerMoney(playerid,ammount)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,ammount);
return 1;
}