#include "nw_i0_plot"
const string ONE_ONLY_TAG = "";//put the tag of the one/per item here
const string DENY = "You may only possess one of that item.";
void main()
{
object oContainer = OBJECT_SELF;
object oPC = GetLastDisturbed();
int nType = GetInventoryDisturbType();
object oItem = GetInventoryDisturbItem();
string sTag = GetTag(oItem);
int nNum; string sRes;
if(sTag != ONE_ONLY_TAG)return;
if(nType != INVENTORY_DISTURB_TYPE_REMOVED)return;
nNum = GetNumItems(oPC, ONE_ONLY_TAG);
if(nNum > 1)
{
sRes = GetResRef(oItem);
CreateItemOnObject(sRes, oContainer);
DestroyObject(oItem, 0.1);
SendMessageToPC(oPC, DENY);
}
}
Modifié par Baragg, 23 février 2011 - 01:21 .