Thanks to both of you. Here is the code for items (after clicking on them):
Code: ags
Dont mind the globalint, its just to check if there is trade in progress.
if (GetGlobalInt(60)>0) {
int seller = ItemOwner();
if (ItemOwner()==0) {player.LoseInventory (isocks); character[INV1].AddInventory (isocks);}
if (ItemOwner()==21) {character[INV1].LoseInventory (isocks); player.AddInventory (isocks);}
if (ItemOwner()==22) {character[INV2].LoseInventory (isocks); character[INV3].AddInventory (isocks);}
if (ItemOwner()==23) {character[INV3].LoseInventory (isocks); character[INV2].AddInventory (isocks);}
}
Dont mind the globalint, its just to check if there is trade in progress.