Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » SSGm Script Question
SSGm Script Question [message #271350] Fri, 06 July 2007 23:47 Go to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
i think this is the basic chat hook



class exampleChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		if (!_stricmp(Get_Player_Name_By_ID(ID),"<nick>")) {
			GameObject *obj = Get_GameObj_By_Player_Name(Text[0].c_str());
			Commands->(what ever i want)
		}
	}
};
ChatCommandRegistrant<exampleChatCommand> exampleChatCommandReg("!example",CHATTYPE_ALL,0,GAMEMODE_ALL);

//******************************************************************************


*dont mind what i edited i just added some of the stuff*

but the problem is i got to have about one code per renegade char and i have to make a new code per nickname of who can use the command how can i just edit this to make it so its one code like above but hav more then 1 person can use it so i dotn ahve to make 1 code per char and then that overgame with like 15 mods

please help and thasnk you

[Updated on: Fri, 06 July 2007 23:47]

Report message to a moderator

Re: SSGm Script Question [message #271448 is a reply to message #271350] Sat, 07 July 2007 12:24 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
so anyone?
Re: SSGm Script Question [message #271450 is a reply to message #271350] Sat, 07 July 2007 12:33 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
You want all mods to be able to use the command?

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: SSGm Script Question [message #271453 is a reply to message #271350] Sat, 07 July 2007 12:38 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
He wants it to read from a mods file or something.
Re: SSGm Script Question [message #271460 is a reply to message #271350] Sat, 07 July 2007 12:47 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
if u can teach me to make it read of stats but if not see how it makes it so only the person here
if (!_stricmp(Get_Player_Name_By_ID(ID),"<nick>")) {
can use the command in the serv thers like 25 mods.....and i need about 1 code per char ingame so lets say theres 20 char inagme it whould be 20 chr times 25 mods = 500 codes sigh just someone help me convert that so it can read of more then one player that could use the command
Re: SSGm Script Question [message #271463 is a reply to message #271350] Sat, 07 July 2007 12:56 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
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

Re: SSGm Script Question [message #271466 is a reply to message #271350] Sat, 07 July 2007 13:17 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
ok so add that include into the the cpp file that im editig? ok


then add the code fill in my command and rest of it along with my commands and crap

then fill out the mod.txt

now where is this mod.txt file at? or has to be att?
Re: SSGm Script Question [message #271467 is a reply to message #271350] Sat, 07 July 2007 13:18 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
... -.-

You make the mods.txt file
Re: SSGm Script Question [message #271473 is a reply to message #271466] Sat, 07 July 2007 13:26 Go to previous messageGo to next message
futura83
Messages: 1285
Registered: July 2006
Location: England
Karma: 0
General (1 Star)
Viva la Resistance!
joe937465 wrote on Sat, 07 July 2007 21:17

ok so add that include into the the cpp file that im editig? ok


then add the code fill in my command and rest of it along with my commands and crap

then fill out the mod.txt

now where is this mod.txt file at? or has to be att?


You are honestly asking where it should be at?


Im not a coder, and i know that it would go in the same directory as the compiled program, unless otherwise stated in the code...


This is a signature. Reading this is wasting your time.
Re: SSGm Script Question [message #271475 is a reply to message #271350] Sat, 07 July 2007 13:28 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
well i say a file like that in the brenbot dir and im think do i do that or make on in the servers data folder? or the main server folder? so i have 3 locations in mind and i just wanna make sure
Re: SSGm Script Question [message #271476 is a reply to message #271473] Sat, 07 July 2007 13:29 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Ancient_and_forever wrote on Sat, 07 July 2007 21:26


Im not a coder



Nor is joe Wink but yeah, that's pretty straight forward i think. There is only a few circumstances that it wont.
Re: SSGm Script Question [message #271479 is a reply to message #271476] Sat, 07 July 2007 13:33 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
RoShamBo wrote on Sat, 07 July 2007 15:29

Ancient_and_forever wrote on Sat, 07 July 2007 21:26


Im not a coder


There is only a few circumstances that it wont.


?
Re: SSGm Script Question [message #271487 is a reply to message #271350] Sat, 07 July 2007 13:48 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
if you run it under the MVS debugger is does some shit to your code. You have to get the full path to the file you need, otherwise it goes to the project directory and not where it is actually run.
Re: SSGm Script Question [message #271490 is a reply to message #271350] Sat, 07 July 2007 13:50 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
If its brenbot you will need to read the levels

Quote:


[ADMINS]
admin1
admin2
admin3

[FULL_MODS]
mod1
mod2

[HALF_MODS]
hmod1
hmod2




goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: SSGm Script Question [message #271492 is a reply to message #271476] Sat, 07 July 2007 13:52 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
so where ever the plugin.cpp goes it goes? if so that will be all i need

also for new codes can i do the same thing just with diff file name?
Re: SSGm Script Question [message #271494 is a reply to message #271350] Sat, 07 July 2007 14:02 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
No offence but how about you try it instead of asking

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: SSGm Script Question [message #271496 is a reply to message #271350] Sat, 07 July 2007 14:06 Go to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
im not yet with my plugin.cpp i got erorrs im not sure to fix yet or where to put ti so i cant test it for atleast a long while
Previous Topic: Chat Hook.
Next Topic: renhelp topic - cleared
Goto Forum:
  


Current Time: Sun Dec 22 10:49:05 MST 2024

Total time taken to generate the page: 0.01126 seconds