title: Finding a way to create a simple timer for a game server
body: <p>I'm creating a <a href="https://github.com/ipr0gr4mipas2/GrowtopiaServer" rel="nofollow noreferrer">game server</a> for <a href="https://growtopiagame.com" rel="nofollow noreferrer">Growtopia</a> in C++, server works great. If you'd like to find more about the game, have a look at the link above. Anyways, My goal is to create a function or some code for &quot;PlayMods&quot;, Essentially PlayMods are just item effects just like how potions work in minecraft, the &quot;PlayMods&quot; run off on a certain time and stop giving you the effect at a certain time. I would like to give a player a &quot;PlayMod&quot; for example, freeze effect for 10 seconds, then in 10 seconds the &quot;PlayMod&quot; is removed from the player.</p>
  <p>I've tried the sleep function, obviously that wouldn't work because it would sleep the server for 'x' amount of seconds. I've tried while functions, dumb way of doing it but didn't work anyways, crashed the server. Not sure how else I could do it.</p>
  <p>Here is some examples of players giving/recieving &quot;PlayMods&quot; in the &quot;Main&quot; server of Growtopia. (couldn't find many videos sorry)</p>
  <p>List of consumables in the game: <a href="https://growtopia.fandom.com/wiki/Items/Consumables" rel="nofollow noreferrer">https://growtopia.fandom.com/wiki/Items/Consumables</a></p>
  <p>Here is a video where a user uses &quot;DuctTape&quot; on themselves and it gives them the ducttape effect for 10 MINUTES. <a href="https://youtu.be/FWc_-cxIu3E?t=3" rel="nofollow noreferrer">https://youtu.be/FWc_-cxIu3E?t=3</a></p>
  <p>Any recommendations or help would be fantastic. Thank you!!</p>
  <p>I'm not the best at C++, However that doesn't stop me from trying and I'm still trying to learn. Here is also a link to a copy of the server's code made by someone else on github. <a href="https://github.com/ipr0gr4mipas2/GrowtopiaServer" rel="nofollow noreferrer">https://github.com/ipr0gr4mipas2/GrowtopiaServer</a></p>
  <p>Photos of playmods
  <a href="https://i.stack.imgur.com/F25jU.png" rel="nofollow noreferrer">Showing a list of playmods active in a users info dialog.</a></p>