SHARE
TWEET

Untitled

a guest Jun 19th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <time.h>
  3.  
  4. #include <es.h>
  5. #include <gamethread.h>
  6. #include <usermsg.h>
  7.  
  8. void clock()
  9. {
  10.     if (getplayercount() > 0)
  11.     {
  12.         int count = getplayercount();
  13.         int* userids[] = new getUseridList(count);
  14.         time_t t;
  15.         time(&t);
  16.         char* s = "ServerClock: ";
  17.         s += ctime(&t);
  18.         for (int id = 0; id < count; id++)
  19.         {
  20.             hudhint(userids[id], s);
  21.         }
  22.         delayedname(1, "serverclock", clock);
  23.     }
  24. }
  25.  
  26. void checkDead()
  27. {
  28.     if (!getplayercount())
  29.     {
  30.         cancelDelayed("serverclock");
  31.     }
  32. }
  33.  
  34. void round_start(char** ev[])
  35. {
  36.     clock();
  37. }
  38.  
  39. void round_end(char** ev[])
  40. {
  41.     cancelDelayed("serverclock");
  42. }
  43.  
  44. void player_disconnect(char** ev[])
  45. {
  46.     delayed(2, checkDead);
  47. }
  48.  
  49. void load()
  50. {
  51.     ServerVar sv("serverclock_ver", 1, "BackRaw's ServerClock");
  52.     sv.makepublic();
  53. }
  54.  
  55. void unload()
  56. {
  57.     cancelDelayed("serverclock");
  58. }
RAW Paste Data
Top