You are here

Item on a floor

2 posts / 0 new
Last post
jestemwlodzimierz
jestemwlodzimierz's picture
Item on a floor

Question: when a PC drops an item on the floor... how do I get the stack size of it? GetItemStackSize() doesn't work.

  • up
    50%
  • down
    50%
kevL's

idk - make sure you've passed in an Item

eg. console script:

// 'getstacksize'
void main()
{
    object oTarget = GetPlayerCurrentTarget(OBJECT_SELF);
    if (GetIsObjectValid(oTarget) && GetObjectType(oTarget) == OBJECT_TYPE_ITEM)
    {
        int iStacksize = GetItemStackSize(oTarget);
        SendMessageToPC(GetFirstPC(FALSE), ". stacksize= " + IntToString(iStacksize));
    }
    else SendMessageToPC(GetFirstPC(FALSE), "<c=red>ERROR :</c> target an item.");
}



works fine here,

  • up
    50%
  • down
    50%