02.06.2020, 00:22
Nгo testei manim. Vк ae se funciona
PHP Code:
stock SaveInventory(playerid)
{
new gItemList[200];
new filename[48], str[64];
GetPlayerName(playerid,filename, 25);
format(str, 64,"Inventory/%s.inv",filename);
new File:file=fopen(str, io_append);
for(new item;item<MAX_INV_ITEMS;item++)
{
if(!strlen(_GetItemNamePVar(playerid,item))||!_GetItemAmountPVar(playerid,item))continue;
format(gItemList,sizeof(gItemList),"%s%s\n%d\n",gItemList,_GetItemNamePVar(playerid,item),_GetItemAmountPVar(playerid,item));
}
fwrite(file, gItemList);
fclose(file);
}