Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Another SSGM Question
Re: Another SSGM Question [message #271881 is a reply to message #271871] Mon, 09 July 2007 02:11 Go to previous messageGo to previous message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma:
Colonel
I just showed you how to have multiple files, admins.txt, mods.txt, etc., and use the same Is_Mod for all of them.

Quote:


You could make Is_Mod work for any text file:

bool Is_Mod(const char *File, const char *Name) {
     fstream file(File, ios::in);
     string tmp;
     while(file >> tmp) { 
         if(strcmp(Name, tmp.c_str()) == 0) {
               return true;
         }
     }
     return false;
}




So

if (Is_Mod("admins.txt",Get_Player_Name_By_ID(ID))) {



The 0/1 has nothing to do with that.


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reborn
Next Topic: coding
Goto Forum:
  


Current Time: Tue Jan 14 03:04:32 MST 2025

Total time taken to generate the page: 0.00740 seconds