dini question [REP+]
#7

Quote:
Originally Posted by FarTooBaked
Посмотреть сообщение
Not really too sure how to show you an example but I think you mean something like this..

pawn Код:
new ExampleStat1[MAX_PLAYERS];
new ExampleStat2[MAX_PLAYERS];
new ExampleStat3[MAX_PLAYERS];
new ExampleStat4[MAX_PLAYERS];

public SavePlayerFile(playerid)
{
    new File[128];
    format(File, sizeof(File), "FolderName/%s", GetPlayerNameEx(playerid));
   
    if(dini_Exists(File))
    {
        dini_IntSet(File, "ExampleStat1", ExampleStat1);
        dini_IntSet(File, "ExampleStat2", ExampleStat1);
        dini_IntSet(File, "ExampleStat3", ExampleStat1);
        dini_IntSet(File, "ExampleStat4", ExampleStat1);
    }
    else
    {
        dini_Create(File);
       
        dini_IntSet(File, "ExampleStat1", ExampleStat1);
        dini_IntSet(File, "ExampleStat2", ExampleStat1);
        dini_IntSet(File, "ExampleStat3", ExampleStat1);
        dini_IntSet(File, "ExampleStat4", ExampleStat1);
    }
    return 1;
}

public LoadPlayerFile(playerid)
{
    new File[128];
    format(File, sizeof(File), "FolderName/%s", GetPlayerNameEx(playerid));

    if(dini_Exists(File))
    {
        ExampleStat1[playerid] = dini_Int(File, "ExampleStat1");
        ExampleStat1[playerid] = dini_Int(File, "ExampleStat2");
        ExampleStat1[playerid] = dini_Int(File, "ExampleStat3");
        ExampleStat1[playerid] = dini_Int(File, "ExampleStat4");
    }
    return 1;
}

public RemovePlayerFile(playerid)
{
    new File[128];
    format(File, sizeof(File), "FolderName/%s", GetPlayerNameEx(playerid));

    if(dini_Exists(File))
    {
        dini_Remove(File);
       
        ExampleStat1[playerid] = -1
        ExampleStat2[playerid] = -1
        ExampleStat3[playerid] = -1
        ExampleStat4[playerid] = -1
    }
    return 1;
}
I will try this

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
Do you mean that u want to delete the files of all players?Or just one player file (or its content)?
Yes. I want to delete the files of all the players

Quote:
Originally Posted by FarTooBaked
Посмотреть сообщение
Oh if you mean to RESET/REMOVE all the data on the players FILE then do it like this...

pawn Код:
new ExampleInt[MAX_PLAYERS];
new Float:ExampleFloat[MAX_PLAYERS];
new ExampleString[MAX_PLAYERS][128];


public RemovePlayerDataFromFile(playerid)
{
    new File[128];
    format(File, sizeof(File), "FolderName/%s", GetPlayerNameEx(playerid));

    if(dini_Exists(File))
    {
        dini_IntSet(File, "ExampleInt", 0);
        dini_SetFloat(File, "ExampleFloat", 0.0);
        dini_Set(File, "ExampleString", "");
    }
    return 1;
}
I think something like that..
I will try this,but it delele and the file with .ini at last? Like "radiobizza.ini" to delete all what contains that file and that file .ini
Reply


Messages In This Thread
dini question [REP+] - by radiobizza - 05.02.2016, 11:17
Re: dini question [REP+] - by Mencent - 05.02.2016, 11:19
Re: dini question [REP+] - by radiobizza - 05.02.2016, 11:20
Re: dini question [REP+] - by FarTooBaked - 05.02.2016, 11:46
Re: dini question [REP+] - by BiosMarcel - 05.02.2016, 11:47
Re: dini question [REP+] - by FarTooBaked - 05.02.2016, 11:54
Re: dini question [REP+] - by radiobizza - 05.02.2016, 12:03
Re: dini question [REP+] - by FarTooBaked - 05.02.2016, 12:11
Re: dini question [REP+] - by BiosMarcel - 05.02.2016, 12:24
Re: dini question [REP+] - by radiobizza - 05.02.2016, 12:45

Forum Jump:


Users browsing this thread: 2 Guest(s)