[Pedido] Salvar Dinheiro
#10

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(playeridDOF2_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;

Reply


Messages In This Thread
Salvar Dinheiro - by Coringa_Vilao - 14.02.2013, 16:43
Re: Salvar Dinheiro - by RookieCoder - 14.02.2013, 16:47
Re: Salvar Dinheiro - by Coringa_Vilao - 14.02.2013, 19:38
Re: Salvar Dinheiro - by Jumper. - 14.02.2013, 20:20
Re: Salvar Dinheiro - by Coringa_Vilao - 15.02.2013, 13:15
Re: Salvar Dinheiro - by smiiir - 15.02.2013, 13:38
Re: Salvar Dinheiro - by DouglasRodrigues - 15.02.2013, 13:40
Re: Salvar Dinheiro - by DrTHE - 15.02.2013, 13:51
Re: Salvar Dinheiro - by Coringa_Vilao - 15.02.2013, 16:53
Re: Salvar Dinheiro - by smiiir - 15.02.2013, 17:04

Forum Jump:


Users browsing this thread: 2 Guest(s)