1. Hi!

    Just wandering if it is at all possible to name a timer which is using Oxide's Timer Library and Destroy it later if needed before the time elapses using its name? If so, what is the general method to do this?

    Cheers!
     
  2. Wulf

    Wulf Community Admin

    Sure, just set it in a variable and then destroy that variable later.
     
  3. Ok, thanks.
    I have been trying to come up with an idea of how to destroy a specific player's GUI/timer and not everyone else's. So I thought perhaps I could use their name to prefix a timer and create it. Would creating multiple timers put a significant enough load on the server to reduce performance?
     
  4. Wulf

    Wulf Community Admin

    Look at my plugins such as QuickSort or Vanish, both handle that without timers.
     
  5. Yeah if you wanted a semi example you can check my most recent plugin :)
     
  6. My GUI will need to be destroyed after a certain amount of time though. Should I still look at them as an example?
     
  7. Wulf

    Wulf Community Admin

    You can use them as an example for storing UI per user. If you want a timer to end after a certain amount of time, you could just add that as part of the timer to end after X repeats, otherwise you'd need to handle it in a similar way, storing each timer in a dictionary or hashset to later destroy by removing and destroying the timer instance.
     
  8. Sorry, handle it in a similar way to what?

    Also I got a timer stored in a variable and destroyed it successfully just now :)
     
  9. I was gonna say store the timer in the dictionary but that works lol
     
  10. I am always tired after work so I tend to slowly get around doing different things until I find what works best, rather than thinking it through properly because my brain doesn't have the workable capacity anymore lol :p I will still need to use a dictionary to store timers private to players.
     
  11. Ah lol ok :)
     
  12. Wulf

    Wulf Community Admin

    Storing it in a dictionary would be best for multiple players, so yes, that would be the better choice.