Author Topic: Finding who's setting a item.  (Read 1011 times)

How would you check who's setting an item on the brick, i know the function (FxDTSbrick::SetItem(%Brick, %Item)). I don't wonna use %brick.client otherwise it'll charge the owner of the brick and not the person who's laying the item.

You could loop through the clients during fxDTSbrick::SetItem(%Brick, %Item) and find who's "wrenchBrick" is equal to that brick. The problem is, it may show up as two people if both have wrenched the brick before.


Code: [Select]
function fxDtsBrick::SetItem(%brick, %item) {
  for(%i = 0; %i < ClientGroup.getCount(); %i++) {
     %cl = ClientGroup.getObject(%i);
     if(%brick.client = %cl.wrenchBrick} //stuff
  }
}

i'm supposing.

Code: [Select]
package BrickItems
{
 function fxDtsBrick::SetItem(%brick, %item) {
   for(%i = 0; %i < ClientGroup.getCount(); %i++) {
      %cl = ClientGroup.getObject(%i);
      if(%brick = %cl.wrenchBrick)
      {
        //Stuff
        Parent::setItem(%brick,%item);
      }
   }
 }
};activatepackage(BrickItems);

i'm supposing.