Why Y_INI create more variables on file. +REP.
#1

Hi, i made a login and register system.

Код:
[Cuenta]
Contraseсa = test123
Dinero = 1000
Banco = 5000
Administrador = 0
Skin = 5
PosicionX = 10.000000
PosicionY = 10.000000
PosicionZ = 10.000000
That's is how the file still when register, when disconnect and it save the variables here will still like that's:

Код:
PosicionX = 1552.196899
PosicionY = -1675.167968
PosicionZ = 16.181770
Administrador = 0
Dinero = 0
[Cuenta]
Contraseсa = test123
Dinero = 1000
Banco = 5000
Administrador = 0
Skin = 5
PosicionX = 10.000000
PosicionY = 10.000000
PosicionZ = 10.000000
їWhy?

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new string[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "/Usuarios/%s.ini", name);
new INI:File = INI_Open(string);
GetPlayerPos(playerid, pInfo[playerid][PosX], pInfo[playerid][PosY], pInfo[playerid][PosZ]);
INI_WriteFloat( File, "PosicionX", pInfo[playerid][PosX] );
INI_WriteFloat( File, "PosicionY", pInfo[playerid][PosY] );
INI_WriteFloat( File, "PosicionZ", pInfo[playerid][PosZ] );
INI_WriteInt( File, "Administrador", pInfo[playerid][pAdministrador] );
INI_WriteInt( File, "Dinero", pInfo[playerid][pDinero] );
INI_Close(File);
}
Reply
#2

Re-write the tag.
Reply
#3

Worked, +REP.
Reply
#4

EDIT: Still saving fail and i added the tag:

Код:
[Cuenta]
Contraseсa = test24
Dinero = 0
Banco = 5000
Administrador = 25
Skin = 5
PosicionX = 1528.841552
PosicionY = -1686.033935
PosicionZ = 13.382812
[Cuenta]
PosicionX = 1526.718383
PosicionY = -1679.337524
PosicionZ = 13.382812
Administrador = 25
Dinero = 0
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new string[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "/Usuarios/%s.ini", name);
new INI:File = INI_Open(string);
GetPlayerPos(playerid, pInfo[playerid][PosX], pInfo[playerid][PosY], pInfo[playerid][PosZ]);
INI_SetTag(File,"Cuenta");
INI_WriteFloat( File, "PosicionX", pInfo[playerid][PosX] );
INI_WriteFloat( File, "PosicionY", pInfo[playerid][PosY] );
INI_WriteFloat( File, "PosicionZ", pInfo[playerid][PosZ] );
INI_WriteInt( File, "Administrador", pInfo[playerid][pAdministrador] );
INI_WriteInt( File, "Dinero", pInfo[playerid][pDinero] );
INI_Close(File);
return 1;
}
Reply
#5

I think you need to write everything under that tag also. (I hate tags :P)
Reply
#6

Need help :c
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)