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 previous message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma:
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

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


Current Time: Fri Nov 08 23:52:35 MST 2024

Total time taken to generate the page: 0.00947 seconds