Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » SSGm Script Question
Re: SSGm Script Question [message #271463 is a reply to message #271350] Sat, 07 July 2007 12:56 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
meh, i'll write some shit code for you.

make sure
#include <fstream>

is at the top of the cpp file


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

class exampleChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
         if(Is_Mod(Get_Player_Name_By_ID(ID))
         {
             Commands->(do something)
         }
         else
         {
                 //this player isn't a mod
         }

};



then, in mods.txt
<nick1>
<nick2>
<nick3>

[Updated on: Sat, 07 July 2007 12:56]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Chat Hook.
Next Topic: renhelp topic - cleared
Goto Forum:
  


Current Time: Sun Dec 22 15:16:01 MST 2024

Total time taken to generate the page: 0.00777 seconds