15.02.2013, 17:04
Coringa tenta isso:
PHP код:
//======= 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;
}