Problems whit DINI
#1

Hi, well I never knew how you use DINI... Generally the think what I do in 'dini' don't works perfectly

In this case, I've a folder called 'Recompensas'
And in the folder should save a file (*.in) with the name of the player. Ex: godoy32.ini
Here's the code

pawn Код:
enum pInfo
{
    ConHIT,
    COMPLETADOS,
    PUESTOS,
};
new aInfo[MAX_PLAYERS][pInfo];
#define SAVERECOMPENSAS "Recompensas/%s.ini"
---
OnPlayerConnect
pawn Код:
new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name));          format(file,sizeof(file),SAVERECOMPENSAS,Name);
    if(!dini_Exists(file)) {
        dini_Create(file);
        dini_IntSet(file,"ConHIT",aInfo[playerid][ConHIT]);
        dini_IntSet(file,"COMPLETADOS",aInfo[playerid][COMPLETADOS]);
        dini_IntSet(file,"PUESTOS",aInfo[playerid][PUESTOS]);
    }
    else if(dini_Exists(file))
    {
    aInfo[playerid][ConHIT] = dini_Int(file,"ConHIT");
    aInfo[playerid][COMPLETADOS] = dini_Int(file,"COMPLETADOS");
    aInfo[playerid][PUESTOS] = dini_Int(file,"PUESTOS");
    }
----
OnPlayerDisconnect
pawn Код:
GetPlayerName(playerid, pname, sizeof(pname)); //Guardamos el nombre del player en la variable pname
        format(archivo, sizeof(archivo), SAVERECOMPENSAS, udb_encode(pname)); // Damos formato a "archivo"
        new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),SAVERECOMPENSAS,Name);
        dini_IntSet(file,"ConHIT",aInfo[playerid][ConHIT]);
        dini_IntSet(file,"COMPLETADOS",aInfo[playerid][COMPLETADOS]);
        dini_IntSet(file,"PUESTOS",aInfo[playerid][PUESTOS]);
How I said, the problem is not created any file (*.ini)
Yes. I have created the folder.

Sorry for my english- I'm learning
Reply


Messages In This Thread
Problems whit DINI - by godoy32 - 08.12.2011, 16:11
Re: Problems whit DINI - by AstonDA-G - 08.12.2011, 16:38
Respuesta: Re: Problems whit DINI - by godoy32 - 08.12.2011, 16:45
Re: Problems whit DINI - by AstonDA-G - 08.12.2011, 17:06
Respuesta: Re: Problems whit DINI - by godoy32 - 08.12.2011, 17:23
Re: Problems whit DINI - by AstonDA-G - 08.12.2011, 17:28
Respuesta: Re: Problems whit DINI - by godoy32 - 08.12.2011, 17:36

Forum Jump:


Users browsing this thread: 1 Guest(s)