#1

hi guys! how to write my inventory save and load script MYSQL R41-2??

THANK YOU AND RESPECT!!!


Code:

Код:
stock SaveItems(playerid)
{
	new m[128];
    format(itemfile,sizeof(itemfile),"/Inv/%s.ini",GetNamei(playerid));
    for(new i; i<MAX_ITEMS; i++)
	{
	    format(m,128,"Item%d",i);
	    dini_Set(itemfile,m,ItemName[playerid][i]);
	    format(m,128,"Itemamount%d",i);
	    dini_IntSet(itemfile,m,ItemAmount[playerid][i]);
	}
	return 1;
}

stock LoadItems(playerid)
{
	new m[128];
    format(itemfile,sizeof(itemfile),"/Inv/%s.ini",GetNamei(playerid));
    if(dini_Exists(itemfile))
    {
        ResetPlayerItems(playerid);
	 	for(new i; i<MAX_ITEMS; i++)
		{
		    format(m,128,"Item%d",i);
		    new item[128];
			format(item,128,"%s",dini_Get(itemfile,m));
		    format(ItemName[playerid][i],128,"%s",item);
		    format(m,128,"Itemamount%d",i);
		    ItemAmount[playerid][i] = dini_Int(itemfile,m);
		}
	}
	else
	{
		dini_Create(itemfile);
		ResetPlayerItems(playerid);
		SaveItems(playerid);
	}
	return 1;
}
Reply
#2

Could you please explain your demand abit more clearly?
Reply
#3

would skip to mysql. write script mysql r41-2 thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)