Exemple #1
0
 public override void OnUse(GameClient session, RoomItem item, int request, bool userHasRights)
 {
     if (session != null)
     {
         if (CoordUtilies.InRange(this.X, this.Y, session.GetHabbo().GetRoomSession().GetRoomUser().X, session.GetHabbo().GetRoomSession().GetRoomUser().Y))
         {
             if (this.ExtraData != "-1")
             {
                 if (request == -1)
                 {
                     this.ExtraData = "0";
                     this.UpdateState(true, true);
                 }
                 else
                 {
                     this.ExtraData = "-1";
                     this.UpdateState(false, true);
                     this.DoUpdate(4);
                 }
             }
         }
         else
         {
             session.GetHabbo().GetRoomSession().GetRoomUser().MoveTo(this.TDC.x, this.TDC.y);
         }
     }
 }
        public override void OnUse(GameClient session, RoomItem item, int request, bool userHasRights)
        {
            if (this.ExtraData != "1" && this.GetBaseItem().VendingIds.Length > 0 && this.Interactor == null)
            {
                if (CoordUtilies.InRange(this.X, this.Y, session.GetHabbo().GetRoomSession().GetRoomUser().X, session.GetHabbo().GetRoomSession().GetRoomUser().Y))
                {
                    this.Interactor = session.GetHabbo().GetRoomSession().GetRoomUser();
                    this.Interactor.RestrictMovementType |= RestrictMovementType.Client;
                    this.Interactor.SetRotation(WalkRotation.Walk(this.Interactor.X, this.Interactor.Y, this.X, this.Y), !this.Interactor.Session.GetHabbo().GetRoomSession().GetRoomUser().HasStatus("sit"));

                    this.ExtraData = "1";
                    this.UpdateState(false, true);
                    this.DoUpdate(2);
                }
                else
                {
                    session.GetHabbo().GetRoomSession().GetRoomUser().MoveTo(this.TDC.x, this.TDC.y);
                }
            }
        }