Home » Renegade Discussions » Mod Forum » brenbot plugin needed
Re: brenbot plugin needed [message #418937 is a reply to message #418863] |
Sun, 31 January 2010 06:17   |
 |
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma:
|
General (3 Stars) |
|
|
The auth_script adds their playerID to a vector, this makes it possible to check whether or not the player is in that vector when they use a chat command. For example:
bool AuthCheck(int ID) {
for (unsigned int i = 0; i < AuthedPlayers.size(); i++) {
if (AuthedPlayers[i].AuthedPlayerName == Get_Player_Name_By_ID(ID)) {
return true;
}
}
return false;
}
class setmapChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
if(AuthCheck(ID) != false){
if (!Text[1].empty()) {
int number = 0;
std::string mapname2 = Text[1].c_str();
int numberofmaps = 0;
for(;*The_Game()->MapList[numberofmaps] != 0; numberofmaps++);
int z = 0;
for (int i = 0; i < numberofmaps; i++) {
if ((stristr(The_Game()->MapList[i],mapname2.c_str()))){
number++;
z = i;
}
}
if (number == 1){
The_Game()->MapNumber = z-1;
mapname = The_Game()->MapList[z];
mapnameannounce();
Console_Input(StrFormat("msg Moderator %s has changed the next map!",Get_Player_Name_By_ID(ID)).c_str());
}
else if(number < 1){
Console_Input(StrFormat("ppage %d Nothing was found at all, are you sure that map is even in rotation?",ID).c_str());
}
else if(number > 1){
for (int i = 0; i < numberofmaps; i++) {
if ((strcmp(The_Game()->MapList[i],mapname2.c_str()))==0) {
The_Game()->MapNumber = i-1;
mapname = The_Game()->MapList[i];
mapnameannounce();
Console_Input(StrFormat("msg Moderator %s has changed the next map!",Get_Player_Name_By_ID(ID)).c_str());
break;
}
}
}
}
}
else {
Console_Input(StrFormat("ppage %d You're not a mod, you need to authenticate to use this command.",ID).c_str());
}
}
};
ChatCommandRegistrant<setmapChatCommand> setmapChatCommandReg("!setnextmap;!SETNEXTMAP;!Setnextmap;!SetNextMap;!snm;!SNM;!set;!SET;!SETNEXT;!setnext;!SetNext",CHATTYPE_ALL,1,GAMEMODE_ALL);
It just allows people to write chat commands for moderators safely, without relying solely on the nick name being the same (easily spoofed if the server allows direct connect).
|
|
|
 |
|
brenbot plugin needed
By: reborn on Sat, 30 January 2010 07:41
|
 |
|
Re: brenbot plugin needed
By: reborn on Sat, 30 January 2010 11:17
|
 |
|
Re: brenbot plugin needed
By: Hex on Sat, 30 January 2010 11:48
|
 |
|
Re: brenbot plugin needed
By: reborn on Sat, 30 January 2010 18:52
|
 |
|
Re: brenbot plugin needed
|
 |
|
Re: brenbot plugin needed
By: reborn on Sun, 31 January 2010 03:11
|
 |
|
Re: brenbot plugin needed
By: Hex on Sun, 31 January 2010 05:21
|
 |
|
Re: brenbot plugin needed
By: reborn on Sun, 31 January 2010 06:17
|
 |
|
Re: brenbot plugin needed
By: Hex on Sun, 31 January 2010 06:44
|
 |
|
Re: brenbot plugin needed
By: reborn on Sun, 31 January 2010 07:20
|
 |
|
Re: brenbot plugin needed
By: raven on Mon, 01 February 2010 04:37
|
 |
|
Re: brenbot plugin needed
By: reborn on Mon, 01 February 2010 04:43
|
 |
|
Re: brenbot plugin needed
|
 |
|
Re: brenbot plugin needed
By: reborn on Mon, 01 February 2010 14:06
|
 |
|
Re: brenbot plugin needed
|
 |
|
Re: brenbot plugin needed
|
 |
|
Re: brenbot plugin needed
|
 |
|
Re: brenbot plugin needed
By: reborn on Tue, 02 February 2010 00:57
|
 |
|
Re: brenbot plugin needed
|
 |
|
Re: brenbot plugin needed
By: reborn on Thu, 04 February 2010 23:43
|
 |
|
Re: brenbot plugin needed
By: reborn on Tue, 09 February 2010 03:38
|
 |
|
Re: brenbot plugin needed
|
Goto Forum:
Current Time: Tue Jul 22 04:25:39 MST 2025
Total time taken to generate the page: 0.01012 seconds
|