I could query the db when a player joins and create a timer for that player only and have it stop when they leave the server. Combining this with checking when they join could keep the timers from needing to change groups while the player isn't connected.
Just outloud thoughts. One of you geniuses will figure out better/more efficient way.
Store the steamid, original group, temp group, time allotted. (I still prefer text, but sure, have it SQL capable for those 'real' servers)
Run a timer where every 6(?) hours, the server checks and loads the next 6 hours of expirations..load those as timers.
Add 'feature' that if a player joins that is in that table during those 6 hours...the host can have that user warned to go beg for more status/pay more money, whatever.
That also brings up another concern... how would I go about detecting if the players group has been changed.. is there is groupchanged hook? lol.. otherwise you could permanently change someone's group while their in a temp group and the script would change their group to whatever you had set it to even though it shouldn't.
Not specifically group changed hook, but, extremely useful.
http://ulyssesmod.net/docs/files/lua/ulib/shared/defines-lua.html#UCLChangedYou should also monitor for bans (auto remove), or kicks (allow 'feature' to have temp group removed, optional (in case they have admin kick wars, etc))
If banned, remove from table (and existing timers) entirely (same as with kick if auto remove enabled)
If promoted, if promo group = temp group, remove from table/timers.
If promoted, if not promo group = temp, change "original group" table to 'new/promo group'.
The only challenge I see after that is having your function determine that the UCLChanged hook your running isn't the changes it may be doing itself.
>Heh. We could almost move this topic to Devs corner.