stock LoadInventory(playerid)
{
new file[200], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "Inventory/%s.sav", name);
PlayerInfo[playerid][Slot[0]] = dini_Get(file, "Slot0");
PlayerInfo[playerid][Slot[1]] = dini_Get(file, "Slot1");
PlayerInfo[playerid][Slot[2]] = dini_Get(file, "Slot2");
PlayerInfo[playerid][Slot[3]] = dini_Get(file, "Slot3");
PlayerInfo[playerid][Slot[4]] = dini_Get(file, "Slot4");
PlayerInfo[playerid][Slot[5]] = dini_Get(file, "Slot5");
PlayerInfo[playerid][Slot[6]] = dini_Get(file, "Slot6");
PlayerInfo[playerid][Slot[7]] = dini_Get(file, "Slot7");
PlayerInfo[playerid][Slot[8]] = dini_Get(file, "Slot8");
PlayerInfo[playerid][Slot[9]] = dini_Get(file, "Slot9");
PlayerInfo[playerid][Slot[10]] = dini_Get(file, "Slot10");
return 1;
}
stock LoadInventory(playerid)
{
new file[50], s[24];
GetPlayerName(playerid,s,24);
format(file,sizeof(file),"Inventory/%s.sav",s);
for(new i; i < 11; i++)format(s,sizeof(s),"Slot%d",i),PlayerInfo[playerid][Slot][i] = dini_Get(file,s);
return 1;
}
/*This line>>*/format(s,sizeof(s),"Slot%d",i),PlayerInfo[playerid][Slot][i] = dini_Get(file, s);
stock LoadInventory(playerid)
{
new file[50], s[24];
GetPlayerName(playerid,s,24);
format(file,sizeof(file),"Inventory/%s.sav",s);
for(new i; i < 11; i++)format(s,sizeof(s),"Slot%d",i),PlayerInfo[playerid][Slot[i]] = strval(dini_Get(file,s));
return 1;
}
format(s, 24, "Slot%d", i),PlayerInfo[playerid][Slot[i]] = dini_Get(file, s);
Not working, Maybe give me any ideas to save player's items Not really wanna use advanced dialogs. |