SA-MP Forums Archive
DINI Problem - 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: DINI Problem (/showthread.php?tid=393474)



DINI Problem - Blackazur - 18.11.2012

Hello, my Problem is that sometimes a Playeraccount is deleted, and all Stats are beginning from 0, from that Player, here the Stock:

Код:
stock CreateAccount(playerid,pass[])
{
    format(str,64,"%s.txt",PlayerName[playerid]);

	dini_Create(str);
	dini_Set(str,"Passwort",pass);
	dini_IntSet(str,"Admin",0);
	dini_IntSet(str,"Geld",0);
	dini_IntSet(str,"Score",0);
	dini_IntSet(str,"Kills",0);
	dini_IntSet(str,"Deaths",0);
	return 1;
}

stock LoadAccount(playerid)
{
    format(str,64,"%s.txt",PlayerName[playerid]);

	PlayerAdmin[playerid] = dini_Int(str,"Admin");
	GivePlayerMoneyEx(playerid,dini_Int(str,"Geld"));
	SetPlayerScore(playerid,dini_Int(str,"Score"));
	PlayerKills[playerid] = dini_Int(str,"Kills");
	PlayerDeaths[playerid] = dini_Int(str,"Deaths");
	return 1;
}

stock SavePlayer(playerid)
{
    format(str,64,"%s.txt",PlayerName[playerid]);

    dini_IntSet(str,"Admin",PlayerAdmin[playerid]);
    dini_IntSet(str,"Geld",PlayerMoney[playerid]);
    dini_IntSet(str,"Score",GetPlayerScore(playerid));
    dini_IntSet(str,"Kills",PlayerKills[playerid]);
    dini_IntSet(str,"Deaths",PlayerDeaths[playerid]);
    return 1;
}



Re: DINI Problem - dr.lozer - 19.11.2012

Because of this much code is deleting the accounts?? Show other code too

like

where u use them>
show the stock codes
everything!