Guest User

Trade OnItemSplit hook

a guest
Oct 8th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1.         void OnItemSplit(Item item, int amount)
  2.         {
  3.             if (item.GetOwnerPlayer() is BasePlayer)
  4.             {
  5.                 OnlinePlayer onlinePlayer;
  6.                 if (onlinePlayers.TryGetValue(item.GetOwnerPlayer(), out onlinePlayer) && onlinePlayer.Trade != null)
  7.                 {
  8.                     OpenTrade t = onlinePlayers[item.GetOwnerPlayer()].Trade;
  9.  
  10.                     if (!t.complete)
  11.                     {
  12.                         t.ResetAcceptance();
  13.  
  14.                         if (t.IsValid())
  15.                         {
  16.                             NextTick(() => ShowTrades(t, "Trade: Pending"));
  17.                         }
  18.                         else
  19.                         {
  20.                             TradeCloseBoxes(t);
  21.                         }
  22.                     }
  23.                 }
  24.             }
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment