Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » !team2 for just admins?
!team2 for just admins? [message #467372] Tue, 15 May 2012 00:24 Go to next message
Distrbd21 is currently offline  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

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[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 Go to previous messageGo to next message
Whitedragon is currently offline  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 #467374 is a reply to message #467372] Tue, 15 May 2012 01:00 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Identify mods/admins by serial hash.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: !team2 for just admins? [message #467383 is a reply to message #467372] Tue, 15 May 2012 09:39 Go to previous messageGo to next message
danpaul88 is currently offline  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.

http://steamsignature.com/card/1/76561197975867233.png

[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 Go to previous message
Distrbd21 is currently offline  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

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Wed, 16 May 2012 15:32]

Report message to a moderator

Previous Topic: server "crash" on quit
Next Topic: !fds
Goto Forum:
  


Current Time: Fri Nov 08 23:48:48 MST 2024

Total time taken to generate the page: 0.00747 seconds