SA-MP Forums Archive
[HELP]Dini - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Dini (/showthread.php?tid=103734)



[HELP]Dini - Dirty_bum - 21.10.2009

i need help with dini, i know how to store stuff with it, but how do i get it out and use the data e.g storing players cash then when they reconnect next time they'll have the cash they had before

i have no code atm

hope this made sense

p.s i know dini_Get but not how to use the right way

Thanks


Re: [HELP]Dini - Abernethy - 21.10.2009

Use this guide, it was very helpful for myself.
http://forum.sa-mp.com/index.php?topic=71935.0


Re: [HELP]Dini - Dirty_bum - 21.10.2009

Quote:
Originally Posted by Abernethy♥
Use this guide, it was very helpful for myself.
http://forum.sa-mp.com/index.php?topic=71935.0
i tryd to use it but i still fails

error 035: argument type mismatch (argument 2)

Код:
enum Account
{
	Playercash[128]
	
}

new PlayerThings[MAX_PLAYERS][Account];

public OnPlayerConnect(playerid)
{
	new Playerstats[100], pCash[128];
	format(pCash,sizeof(pCash),"%d",GetPlayerMoney(playerid));
	format(Playerstats,sizeof(Playerstats),PlayerInfo,pName);
	if(!dini_Exists(Playerstats))
	{
	dini_Create(Playerstats);
    dini_Set(Playerstats,"Cash",pCash);
	}
	strcat(PlayerThings[playerid][Playercash], dini_Get(Playerstats,"pCash"));
	if(!dini_Exists(Playerstats))
	{
	new string[128],mon[256];
	string = dini_Get(Playerstats, "pCash");
	format(mon,sizeof(mon),"%d", string);
	GivePlayerMoney(playerid, mon); //Error on this line
	}
	return 1;
}
It prob would of failed anyway im still newb scripter

anyhelp?


Re: [HELP]Dini - Abernethy - 21.10.2009

http://forum.sa-mp.com/index.php?topic=126584.0
When you've registered, use dini_IntSet(file, "Cash", 0); & on login use, SetPlayerMoney(playerid, dini_Int(file, "Cash"));


Re: [HELP]Dini - Dirty_bum - 21.10.2009

Quote:
Originally Posted by Abernethy♥
http://forum.sa-mp.com/index.php?topic=126584.0
When you've registered, use dini_IntSet(file, "Cash", 0); & on login use, SetPlayerMoney(playerid, dini_Int(file, "Cash"));
Thanks this helped alot