home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / SYSOP / MODS1.ZIP / GIVEFPS.MOD < prev    next >
Text File  |  1993-03-31  |  3KB  |  91 lines

  1. Bast #1 @7319
  2. Wed Mar 24 16:46:21 1993
  3. /**
  4. ┌────────────────────────────────────────────────────────────────────────────┐
  5. │ Mod Name: File Point Giver        Mod Author: Bast                         │
  6. │ Difficulty: ▒▒░░░░░░░░            Date: 03/24/93                           │
  7. │ WWIV Version: 4.22 and above                                               │
  8. │ Files Affected: BBS.C                                                      │
  9. │ Description: Gives Users File Points. For Use With TFC019.MOD, The File    │
  10. │              Point System By The Flying Chicken.                           │
  11. └────────────────────────────────────────────────────────────────────────────┘
  12. **/
  13.  
  14. /** STEP 1: Backup Your Source!!!!!
  15.             I cannot and will not be responsible for anything bad
  16.             happening to your source code because you didn't back
  17.             it up.
  18. **/
  19.  
  20. /** STEP 2: Open BBS.C
  21.             Search For/Modify Following
  22. **/
  23.  
  24. void mainmenu(void)
  25. {
  26.   char *s, s1[81],s2[81],fps[5],ch,ch2;    /** Add fps[5] **/
  27.   int i,done;
  28.   long l;
  29.  
  30.         .
  31.         .
  32.         .
  33.  
  34.     if (strcmp(s,"GFILEEDIT")==0) {
  35.       sysoplog(get_stringx(1,5));
  36.       gfileedit();
  37.     }
  38.     if (strcmp(s,"GIVEFPS")==0) {    /** Add From Here **/
  39.        prt(1,"How many? ");
  40.        input(fps,4);
  41.        if(fps[0]==0) i=-1;
  42.        else i=atoi(fps);
  43.        give_fps(i);
  44.     }                                /** To Here **/
  45.  
  46. /** At The Bottom Of BBS.C, Add The Following Function **/
  47.  
  48. void give_fps(int x)                /** Give All Users FilePoints **/
  49. {
  50.     int i;
  51.     userrec u;
  52.     long l;
  53.  
  54.     for(i=1;i<=number_userrecs();i++)
  55.     {
  56.       read_user(i,&u);
  57.  
  58.       if(x==-1) {
  59.         l = (u.uk * 2) - u.dk;
  60.         if (l>0)
  61.             u.filepoints = l;
  62.         else
  63.             u.filepoints = 0;
  64.       } else
  65.          u.filepoints=(long) x;
  66.       write_user(i,&u);
  67.       close_user();
  68.     }
  69. }
  70.  
  71. Save/Close BBS.C
  72.  
  73. Compile And You're Done!
  74. Typing 1//GIVEFPS 0from Main Menu Will Allow You To Give All Users
  75. A Specified Amount Of FilePoints. Entering A Value Of -1 (negative one)
  76. Will Use The Flying Chicken's Formula For Giving The Users File Points.
  77. I Wrote This Because TFC's CNVTUSER.C Program Didn't Work, And My
  78. External Program To Do The Same Didn't Work. I Hope This Helps You Out.
  79.  
  80. Thanks Go To The Flying Chicken For Writing The File Point System,
  81. And To Wayne Bell For Writing WWIV.
  82.  
  83.  
  84.                                 - Bast
  85.  
  86. 1@7319  WWIVNet
  87. 2@17306 WWIVLink
  88. 2@7309  IceNet
  89.  
  90. <EOF>
  91.