[Ajuda] fcreat nгo lк
#10

Returna o valor verdadeiro como o Rjjj falou

pawn Код:
stock SalvarDados(playerid)
{
    new string[128]; // cria a string que vai alojar o diretуrio da conta do jogador
    format(string, sizeof(string), "Arquivos/Users/%s.ini", PlayerName(playerid)); // formata a string com o diretуrio como conteъdo da mesma
    new File:file = fopen(string, io_write); // cria uma variбvel file, que abre o arquivo com permissгo para escrever e o cria se ainda nгo existir
    if(file) // se o arquivo a abrir й o arquivo correto
    {
        new var[32]; // variбvel que vai alojar os dados que queremos salvar
        format(var, sizeof(var), "Dinheiro:%d", GetPlayerMoney(playerid)); fwrite(file, var); // no caso aqui vai format 'var' com o dinheiro do jogador e escrever (fwrite) no arquivo o dinheiro
        format(var, sizeof(var), "SkinID:%d", GetPlayerSkin(playerid)); fwrite(file, var); // aqui vai salvar a skin
        format(var, sizeof(var), "ProfID:%d", gTeam[playerid]); fwrite(file, var); //salva o gteam
        fclose(file); // depois de mexer no arquivo se deve fechб-lo para nгo corromper e para nгo ficar aberto, podendo perder dados
        return 1;
    }
 return 1;
}
Reply


Messages In This Thread
[Ajuda] fcreat nгo lк - by JOKERBOY - 12.04.2011, 14:41
Re: [help] fcreat nгo lк - by Macintosh - 12.04.2011, 14:43
Re: [help] fcreat nгo lк - by JOKERBOY - 12.04.2011, 15:03
Re: [Ajuda] fcreat nгo lк - by zbt_Daimyo - 12.04.2011, 16:03
Re: [Ajuda] fcreat nгo lк - by Macintosh - 12.04.2011, 16:19
Re: [Ajuda] fcreat nгo lк - by Dr_Pawno - 12.04.2011, 16:22
Re: [Ajuda] fcreat nгo lк - by rjjj - 12.04.2011, 17:49
Re: [Ajuda] fcreat nгo lк - by zSuYaNw - 12.04.2011, 18:28
Re: [Ajuda] fcreat nгo lк - by JOKERBOY - 12.04.2011, 22:49
Re: [Ajuda] fcreat nгo lк - by Macintosh - 12.04.2011, 22:53

Forum Jump:


Users browsing this thread: 1 Guest(s)