Advertisement
lucasgautheron

Untitled

May 28th, 2011
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. // server.cpp
  2. // somewhere before serverslice() definition
  3. int nextspammsg = 0, nextspammsgmillis = 0;
  4.  
  5. void spammessage()
  6. {
  7.     if(!scl.spammsgs.length()) return;
  8.     if(servmillis > nextspammsgmillis)
  9.     {
  10.         if(numclients() > 0)
  11.         {
  12.             if(!scl.spammsgs.inrange(nextspammsg)) nextspammsg = 0;
  13.             sendservmsg(scl.spammsgs[nextspammsg]);
  14.             nextspammsg++;
  15.         }
  16.         nextspammsgmillis = servmillis + 10000;
  17.     }
  18. }
  19. //after if(servmillis>nextstatus) block into serverslice definition
  20. spammessage();
  21.  
  22. // protos.h
  23. // replace vector<const char *> adminonlymaps by :
  24. vector<const char *> adminonlymaps, spammsgs;
  25. // bool checkarg()'s switch
  26. case 'G': spammsgs.add(a); break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement