Thread: /time countdown
View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-29-2022 , 19:27   Re: /time countdown
Reply With Quote #8

@EFFx,
  • According to the formatex() documentation, using the output string as an input is not allowed. But, I'm assuming you're not getting any errors so in this one specific case, it may work. As far as I have seen, the proper way to append with formatex() is the way that I've done it in my plugin above.
  • You actually have a potential overflow error because you're using iLen which is an input to effectively index a hard coded array inside the function (i.e. szMessageFmt). Simply remove szMessageFmt entirely and use szMessage directly.
  • The way you calculate each of the time units requires more operations than the way that I do it though it's unlikely to cause any significant performance hit.
__________________
fysiks is offline