[Ajuda] fcreat nгo lк
#6

Mude isso:
Код:
        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
por isso:
Код:
        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
depois adicione isso:
pawn Код:
forward CarregarDados(playerid);
forward split(const strsrc[], strdest[][], delimiter);
public CarregarDados(playerid);
{
    new Status[3][64];// o [3] й o numero de coisas que vocк salvou
    new string[256];
    format(string, 256, "Arquivos/Users/%s.ini", PlayerName(playerid));
    if (fexist(string)
    {
        new idx;
        while (idx < sizeof(Status))//Carrega as Strings
        {
            new File: file = fopen(string, io_read), dinheiro, skin;
            fread(file, string);
            split(string, Status, ',');
            dinheiro = strval(Status[0]); GivePlayerMoney(playerid, dinheiro);// o [0] й a 1° coisa que salvou
            skin = strval(Status[1]); SetPlayerSkin(playerid, skin);// o [1] й a 2° coisa que salvou
            gTeam[playerid] = strval(Status[2]);// o [2] й a 3° coisa que salvou
            idx++
        }
        fclose(file);
    }
    else
    {
        SendClientMessage(playerid, 0x666666AA, "Vocк nгo й registrado.");
    }
    return 1;
}
public split(const strsrc[], strdest[][], delimiter)
{
    new i, li;
    new aNum;
    new len;
    while(i <= strlen(strsrc)){
        if(strsrc[i]==delimiter || i==strlen(strsrc)){
            len = strmid(strdest[aNum], strsrc, li, i, 128);
            strdest[aNum][len] = 0;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return 1;
}
Espero que funcione =D
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)