Why Y_INI create more variables on file. +REP. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why Y_INI create more variables on file. +REP. (
/showthread.php?tid=529895)
Why Y_INI create more variables on file. +REP. -
xHanks - 04.08.2014
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);
}
Re: Why Y_INI create more variables on file. +REP. -
Stinged - 04.08.2014
Re-write the tag.
Re: Why Y_INI create more variables on file. +REP. -
xHanks - 04.08.2014
Worked, +REP.
Re: Why Y_INI create more variables on file. +REP. -
xHanks - 04.08.2014
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;
}
Re: Why Y_INI create more variables on file. +REP. -
Stinged - 04.08.2014
I think you need to write everything under that tag also. (I hate tags :P)
Re: Why Y_INI create more variables on file. +REP. -
xHanks - 04.08.2014
Need help :c