SSGm Script Question [message #271350] |
Fri, 06 July 2007 23:47 |
_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 #271460 is a reply to message #271350] |
Sat, 07 July 2007 12:47 |
_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 |
|
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
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
[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 |
_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 #271473 is a reply to message #271466] |
Sat, 07 July 2007 13:26 |
|
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 |
_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 #271479 is a reply to message #271476] |
Sat, 07 July 2007 13:33 |
_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 #271492 is a reply to message #271476] |
Sat, 07 July 2007 13:52 |
_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 #271496 is a reply to message #271350] |
Sat, 07 July 2007 14:06 |
_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
|
|
|