Yini double saving -
Glad2BeHere - 13.12.2012
Information is saving twice with yini y? Nope i dont have it twice :/
PHP Code:
[data]
Password = 73400763
Cash = 5000
Bank = 2500
Gold = 1
Health = 100.000000
Armour = 25.000000
Player X pos = 0.000000
Player Y pos = 0.000000
Player Z pos = 0.000000
Player A pos = 0.000000
Interior = 0
Virtual World = 0
Weapon Slot 1 = 0
Weapon Slot 2 = 0
Weapon Slot 3 = 0
Weapon Slot 4 = 0
Weapon Slot 5 = 0
Weapon Slot 6 = 0
Weapon Slot 7 = 0
Weapon Slot 8 = 0
Weapon Slot 9 = 0
Weapon Slot 10 = 0
Weapon Slot 11 = 0
Weapon Slot 12 = 0
Weapon Slot 13 = 0
Ammo Slot 1 = 0
Ammo Slot 2 = 0
Ammo Slot 3 = 0
Ammo Slot 4 = 0
Ammo Slot 5 = 0
Ammo Slot 6 = 0
Ammo Slot 7 = 0
Ammo Slot 8 = 0
Ammo Slot 9 = 0
Ammo Slot 10 = 0
Ammo Slot 11 = 0
Ammo Slot 12 = 0
Ammo Slot 13 = 0
Admin = 0
Tutorial = 3
Banned = 0
Kills = 0
Deaths = 0
Player X pos = 0.000000
Player Y pos = 0.000000
Player Z pos = 25.000000
Player A pos = 0.000000
Virtual World = 0
Weapon Slot 1 = 0
Weapon Slot 2 = 0
Weapon Slot 3 = 0
Weapon Slot 4 = 0
Weapon Slot 5 = 0
Weapon Slot 6 = 0
Weapon Slot 7 = 0
Weapon Slot 8 = 0
Weapon Slot 9 = 0
Weapon Slot 10 = 0
Weapon Slot 11 = 0
Weapon Slot 12 = 0
Weapon Slot 13 = 0
Ammo Slot 1 = 0
Ammo Slot 2 = 0
Ammo Slot 3 = 0
Ammo Slot 4 = 0
Ammo Slot 5 = 0
Ammo Slot 6 = 0
Ammo Slot 7 = 0
Ammo Slot 8 = 0
Ammo Slot 9 = 0
Ammo Slot 10 = 0
Ammo Slot 11 = 0
Ammo Slot 12 = 0
Ammo Slot 13 = 0
Re: Yini double saving -
[HK]Ryder[AN] - 13.12.2012
show the code..
Re: Yini double saving -
LarzI - 13.12.2012
https://sampforum.blast.hk/showthread.php?tid=355296
#6: You should always be providing code! People cannot help you if they cannot see what's wrong with the code.
Re: Yini double saving -
Glad2BeHere - 13.12.2012
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
if(LoggedIn[playerid] == 1)
{
new INI:File = INI_Open(UserPath(playerid));
GetPlayerPos(playerid,PlayerInfo[playerid][posX],PlayerInfo[playerid][posY],PlayerInfo[playerid][posZ]);
GetPlayerFacingAngle(playerid,PlayerInfo[playerid][posA]);
GetPlayerInterior(PlayerInfo[playerid][pInterior]);
GetPlayerVirtualWorld(PlayerInfo[playerid][pVirtualWorld]);
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]);
INI_WriteInt(File,"Gold",PlayerInfo[playerid][pGold]);
INI_WriteFloat(File,"Health",PlayerInfo[playerid][pHealth]);
INI_WriteFloat(File,"Armour",PlayerInfo[playerid][pArmour]);
INI_WriteFloat(File,"Player X pos",PlayerInfo[playerid][posX]);
INI_WriteFloat(File,"Player Y pos",PlayerInfo[playerid][posY]);
INI_WriteFloat(File,"Player Z pos",PlayerInfo[playerid][posZ]);
INI_WriteFloat(File,"Player A pos",PlayerInfo[playerid][posA]);
INI_WriteInt(File,"Interior",PlayerInfo[playerid][pInterior]);
INI_WriteInt(File,"Virtual World",PlayerInfo[playerid][pVirtualWorld]);
INI_WriteInt(File,"Weapon Slot 1",PlayerInfo[playerid][pWeapon][0]);
INI_WriteInt(File,"Weapon Slot 2",PlayerInfo[playerid][pWeapon][1]);
INI_WriteInt(File,"Weapon Slot 3",PlayerInfo[playerid][pWeapon][2]);
INI_WriteInt(File,"Weapon Slot 4",PlayerInfo[playerid][pWeapon][3]);
INI_WriteInt(File,"Weapon Slot 5",PlayerInfo[playerid][pWeapon][4]);
INI_WriteInt(File,"Weapon Slot 6",PlayerInfo[playerid][pWeapon][5]);
INI_WriteInt(File,"Weapon Slot 7",PlayerInfo[playerid][pWeapon][6]);
INI_WriteInt(File,"Weapon Slot 8",PlayerInfo[playerid][pWeapon][7]);
INI_WriteInt(File,"Weapon Slot 9",PlayerInfo[playerid][pWeapon][8]);
INI_WriteInt(File,"Weapon Slot 10",PlayerInfo[playerid][pWeapon][9]);
INI_WriteInt(File,"Weapon Slot 11",PlayerInfo[playerid][pWeapon][10]);
INI_WriteInt(File,"Weapon Slot 12",PlayerInfo[playerid][pWeapon][11]);
INI_WriteInt(File,"Weapon Slot 13",PlayerInfo[playerid][pWeapon][12]);
INI_WriteInt(File,"Ammo Slot 1",PlayerInfo[playerid][pAmmo][0]);
INI_WriteInt(File,"Ammo Slot 2",PlayerInfo[playerid][pAmmo][1]);
INI_WriteInt(File,"Ammo Slot 3",PlayerInfo[playerid][pAmmo][2]);
INI_WriteInt(File,"Ammo Slot 4",PlayerInfo[playerid][pAmmo][3]);
INI_WriteInt(File,"Ammo Slot 5",PlayerInfo[playerid][pAmmo][4]);
INI_WriteInt(File,"Ammo Slot 6",PlayerInfo[playerid][pAmmo][5]);
INI_WriteInt(File,"Ammo Slot 7",PlayerInfo[playerid][pAmmo][6]);
INI_WriteInt(File,"Ammo Slot 8",PlayerInfo[playerid][pAmmo][7]);
INI_WriteInt(File,"Ammo Slot 9",PlayerInfo[playerid][pAmmo][8]);
INI_WriteInt(File,"Ammo Slot 10",PlayerInfo[playerid][pAmmo][9]);
INI_WriteInt(File,"Ammo Slot 11",PlayerInfo[playerid][pAmmo][10]);
INI_WriteInt(File,"Ammo Slot 12",PlayerInfo[playerid][pAmmo][11]);
INI_WriteInt(File,"Ammo Slot 13",PlayerInfo[playerid][pAmmo][12]);
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Tutorial",PlayerInfo[playerid][pTut]);
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_Close(File);
}
return 1;
}
Re: Yini double saving -
[HK]Ryder[AN] - 13.12.2012
Can you show how you save it on register?
Re: Yini double saving -
Lordzy - 13.12.2012
Do you use this same code on more than one script? Maybe that also could be a reason.
Re: Yini double saving -
LarzI - 13.12.2012
Should not be part of the issue what so ever, but are you not supposed to set the login variable to false after checking if it's true?
Re: Yini double saving -
Glad2BeHere - 13.12.2012
Take time nuh, ummm when a player connects loggin = 0; when the spawn it goes to 1 val okay,
Next nope only folder that shares the information
[registry + login]
pawn Code:
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Bank",0);
INI_WriteInt(File,"Gold",0);
INI_WriteFloat(File,"Health",0);
INI_WriteFloat(File,"Armour",0);
INI_WriteFloat(File,"Player X pos",0);
INI_WriteFloat(File,"Player Y pos",0);
INI_WriteFloat(File,"Player Z pos",0);
INI_WriteFloat(File,"Player A pos",0);
INI_WriteInt(File,"Interior",0);
INI_WriteInt(File,"Virtual World",0);
INI_WriteInt(File,"Weapon Slot 1",0);
INI_WriteInt(File,"Weapon Slot 2",0);
INI_WriteInt(File,"Weapon Slot 3",0);
INI_WriteInt(File,"Weapon Slot 4",0);
INI_WriteInt(File,"Weapon Slot 5",0);
INI_WriteInt(File,"Weapon Slot 6",0);
INI_WriteInt(File,"Weapon Slot 7",0);
INI_WriteInt(File,"Weapon Slot 8",0);
INI_WriteInt(File,"Weapon Slot 9",0);
INI_WriteInt(File,"Weapon Slot 10",0);
INI_WriteInt(File,"Weapon Slot 11",0);
INI_WriteInt(File,"Weapon Slot 12",0);
INI_WriteInt(File,"Weapon Slot 13",0);
INI_WriteInt(File,"Ammo Slot 1",0);
INI_WriteInt(File,"Ammo Slot 2",0);
INI_WriteInt(File,"Ammo Slot 3",0);
INI_WriteInt(File,"Ammo Slot 4",0);
INI_WriteInt(File,"Ammo Slot 5",0);
INI_WriteInt(File,"Ammo Slot 6",0);
INI_WriteInt(File,"Ammo Slot 7",0);
INI_WriteInt(File,"Ammo Slot 8",0);
INI_WriteInt(File,"Ammo Slot 9",0);
INI_WriteInt(File,"Ammo Slot 10",0);
INI_WriteInt(File,"Ammo Slot 11",0);
INI_WriteInt(File,"Ammo Slot 12",0);
INI_WriteInt(File,"Ammo Slot 13",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Tutorial",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
PlayerInfo[playerid][pHealth] = 100;
PlayerInfo[playerid][pArmour] = 25;
PlayerInfo[playerid][pCash] = 5000;
PlayerInfo[playerid][pBank] = 2500;
PlayerInfo[playerid][pGold] = 1;
SpawnPlayer(playerid);
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
Re: Yini double saving -
Glad2BeHere - 13.12.2012
The boss has spoken no spaces with, who better to make a statement the Mr.creator, life saver.......