[HELP]Dini
#1

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
Reply
#2

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

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?
Reply
#4

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"));
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)