for (new d = 0; d < INV_MAX_SLOTS; d++)
{
//blahblahblah
}
for (new d = 0; d < INV_MAX_SLOTS; d++)
{
RemoveItemFromInventory(playerid, d);
}
RemoveItemFromInventory(playerid, slot);
enum yInfo
{
Slot0,
Slot1,
Slot2,
Slot3
}
new InvInfo[MAX_PLAYERS][yInfo];
INI_WriteInt(File, "Slot0", GetItemType(GetInventorySlotItem(playerid, 0)));
INI_WriteInt(File, "Slot1", GetItemType(GetInventorySlotItem(playerid, 1)));
INI_WriteInt(File, "Slot2", GetItemType(GetInventorySlotItem(playerid, 2)));
INI_WriteInt(File, "Slot3", GetItemType(GetInventorySlotItem(playerid, 3)));
GetInventorySlotItem(playerid, slot); //returns the id of an item
GetItemType(itemid); //Well ... it gets the type of an item...
INI_Int("Slot0",InvInfo[playerid][Slot0]);
INI_Int("Slot1",InvInfo[playerid][Slot1]);
INI_Int("Slot2",InvInfo[playerid][Slot2]);
INI_Int("Slot3",InvInfo[playerid][Slot3]);
AddItemToInventory(playerid, CreateItem(InvInfo[playerid][Slot0]), 1);
AddItemToInventory(playerid, CreateItem(InvInfo[playerid][Slot1]), 1);
AddItemToInventory(playerid, CreateItem(InvInfo[playerid][Slot2]), 1);
AddItemToInventory(playerid, CreateItem(InvInfo[playerid][Slot3]), 1);
#define INV_MAX_SLOTS 4
enum yInfo
{
Slot[INV_MAX_SLOTS] // 4 slots
}
new InvInfo[MAX_PLAYERS][yInfo];
new str[10];
for(new slot = 0; slot != INV_MAX_SLOTS; slot++)
{
format(str,sizeof(str),"Slot%d",slot);
INI_WriteInt(File, str, GetItemType(GetInventorySlotItem(playerid, slot)));
}
new str[10];
for(new slot = 0; slot != INV_MAX_SLOTS; slot++)
{
format(str,sizeof(str),"Slot%d",slot);
INI_Int(str, InvInfo[playerid][Slot][slot]);
}
for(new slot = 0; slot != INV_MAX_SLOTS; slot++)
AddItemToInventory(playerid, CreateItem(InvInfo[playerid][Slot][slot]), 1);
pawn Код:
Writting: pawn Код:
Reading: pawn Код:
Spawn: pawn Код:
|
for (new d = 0; d < INV_MAX_SLOTS; d++)
{
RemoveItemFromInventory(playerid, d);
}
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
[04:30:57] ERROR: Item creation with undefined typeid (-1) failed.
#define INVALID_ITEM_TYPE (ItemType:-1)
for(new slot = 0; slot != INV_MAX_SLOTS; slot++)
if(InvInfo[playerid][Slot][slot] != INVALID_ITEM_TYPE)
AddItemToInventory(playerid, CreateItem(InvInfo[playerid][Slot][slot]), 1);