!team2 for just admins? [message #467372] |
Tue, 15 May 2012 00:24 |
|
Distrbd21
Messages: 743 Registered: September 2008
Karma: 0
|
Colonel |
|
|
ok so I have it set up so only admins can use this command if there name is the same as in the code.
BUT the problem I have with that is, say a non admin joins with our name when we aren't on the server and use's the command.
What I'm asking is there away to define it more then that?
like maybe what a bot does, when it has you auth your self or login?
class team2ChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text, int ChatType) {
std::string name = Get_Player_Name(Get_GameObj(ID));
GameObject *obj = Get_GameObj(ID);
if (name == "Distrbd21" || name == "Chevy" || name == "Darth3369")
{
if (Text[1] == "?") {
Console_Input(StrFormat("ppage %d Syntax: !team2 <player id> <team number> [usage: Teams the player to the team specified.]",ID).c_str());
}
else if (!Text[1].empty()) {
int pid = atoi(Text[1].c_str());
int team = atoi(Text[2].c_str());
Console_Input(StrFormat("team2 %d %d",pid,team).c_str());
Console_Input(StrFormat("cmsg 255,255,255 %s teamed %s to %ls",Get_Player_Name(obj), Get_Player_Name(Get_GameObj(pid)), Get_Wide_Team_Name(team)).c_str());
}
else
{
Console_Input(StrFormat("ppage %d Syntax: !team2 <player id> <team number> [usage: Teams the player to the team specified.]",ID).c_str());
Console_Input(StrFormat("ppage %d Error: Invalid parameters sent",ID).c_str());
}
}
else
{
Console_Input(StrFormat("sndp %d 00-n008e.wav",ID).c_str());
}
}
};
ChatCommandRegistrant<team2ChatCommand> team2ChatCommand_Registrant("!team2",CHATTYPE_ALL, 0, GAMEMODE_ALL);
Live Your Life Not Some one Else's.| Sharing Is Caring
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
[Updated on: Tue, 15 May 2012 00:26] Report message to a moderator
|
|
|
Re: !team2 for just admins? [message #467373 is a reply to message #467372] |
Tue, 15 May 2012 00:52 |
|
Whitedragon
Messages: 832 Registered: February 2003 Location: California
Karma: 1
|
Colonel |
|
|
You might be able to piggy back on your bot's moderation system. Does the bot send a host message when a moderator identifies? If so you could try catching this message with the host hook and adding the player to a vector. Then check if that player is in the vector when they try to use the command.
If that's not possible you'll pretty much need to create an entire moderation system which would be a lot of work for one command.
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 - )
|
|
|
|
Re: !team2 for just admins? [message #467383 is a reply to message #467372] |
Tue, 15 May 2012 09:39 |
|
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma: 0
|
General (5 Stars) |
|
|
Why not just use the existing bot to send the team2 command and restrict it via the bots own permissions system? BRenBot can already do everything you're trying to do out of the box... fairly sure all the other mainstream bots can too.
[Updated on: Tue, 15 May 2012 09:40] Report message to a moderator
|
|
|
Re: !team2 for just admins? [message #467387 is a reply to message #467372] |
Tue, 15 May 2012 12:04 |
|
Distrbd21
Messages: 743 Registered: September 2008
Karma: 0
|
Colonel |
|
|
NVM thanks for y'all helping me.
BUT I got the person that made the sciprts to begin with to help me through it.
Darknes2 FTW ;p
Live Your Life Not Some one Else's.| Sharing Is Caring
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
[Updated on: Wed, 16 May 2012 15:32] Report message to a moderator
|
|
|