Inventory won't save
#1

Hello there. I have been trying to implement an inventory (v-inventory) script into my gamemode. It worked fine in my old one, but for some reason it will simply not allow me to load the inventories. They save fine, the system works fine with spawning items and I can set the slots. But it simply won't load them again.

I have tried executing it on "LoadInventory(playerid);" OnPlayerConnect, OnPlayerSpawn and it just has no effect. I even added it to a command and still, no effect.

Код:
LoadInventory(playerid)
{
    new file[64];format(file,sizeof(file),"Inventory/%s.inv",GetName(playerid));
    new string[128];
    if(!fexist(file)) return 1;
	file_Open(file);
	InvInfo[playerid][MSlot] = file_GetVal("MSlot");
	InvInfo[playerid][Slotu] = file_GetVal("Slotu");
	for(new i = 0 ; i < MAX_INVENTOY_SLOTS ; i ++)
	{
	format(string,sizeof(string),"Slot%d",i);
	InvInfo[playerid][iSlot][i] = file_GetVal(string);
    format(string,sizeof(string),"Amount%d",i);
	InvInfo[playerid][iAmount][i] = file_GetVal(string);
	}
	file_Close();
	print("loaded player backpack");
	return 1;
}
I added a print to see if it actually loads, and it does, but the slots does NOT load.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)