Junior Spellweaver
- Joined
- Mar 22, 2008
- Messages
- 139
- Reaction score
- 5
benjoo made this, but I didnt really like it, so I revised it a bit, I'm working on the reasons. Shouldnt be too hard...
Place this into MySQLM.cpp:
Place this into your MySQLM.h:
Place this into your Players.cpp:
How to use:
Type !ban <charname>
and it will ban them permanently...
Place this into MySQLM.cpp:
Code:
void MySQL::Ban(int UserID){
char query[255];
sprintf_s(query, 255, "UPDATE users SET ban_reason='00' where ID=%d",UserID);
sprintf_s(query, 255, "UPDATE users SET ban_expire='9999-04-23 17:56:14' where ID=%d",UserID);
mysql_query(&maple_db,query);
printf("UserID %d Banned!\n",UserID);
}
void MySQL::unBan(int UserID){
char query[255];
sprintf_s(query, 255, "UPDATE users SET ban_reason='0' where ID=%d",UserID);
sprintf_s(query, 255, "UPDATE users SET ban_expire='0000-00-00 00:00:00' where ID=%d",UserID);
mysql_query(&maple_db,query);
printf("UserID %d Banned!\n",UserID);
}
Place this into your MySQLM.h:
Code:
static void Ban(int UserName);
static void UnBan(int UserName);
Place this into your Players.cpp:
Code:
else if(strcmp(command, "ban") ==0){
char* user = next_token;
printf("Selected %s\n", user);
MySQL::Ban(MySQL::getID(user));
printf("Banned %s\n", user);
}
else if(strcmp(command, "unban") ==0){
char* user = next_token;
printf("Selected %s\n", user);
MySQL::unBan(MySQL::getID(user));
printf("Unbanned %s\n", user);
}
How to use:
Type !ban <charname>
and it will ban them permanently...
Last edited: