08.12.2011, 16:11
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
---
OnPlayerConnect
----
OnPlayerDisconnect
How I said, the problem is not created any file (*.ini)
Yes. I have created the folder.
Sorry for my english- I'm learning
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]);
Yes. I have created the folder.
Sorry for my english- I'm learning