Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] ban <charname>

Status
Not open for further replies.
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:
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:
Joined
Aug 8, 2007
Messages
470
Reaction score
82
Re: [Release] !ban

Permanently is just the way people want it, goodjob man, all we need now is ip ban and mac ban lol. Odin has it i wonder if its possible to switch how they do it from Java to C++? If its possible then titan is really getting along =)
 
Junior Spellweaver
Joined
Mar 22, 2008
Messages
139
Reaction score
5
Re: [Release] !ban

Permanently is just the way people want it, goodjob man, all we need now is ip ban and mac ban lol. Odin has it i wonder if its possible to switch how they do it from Java to C++? If its possible then titan is really getting along =)

I think IP bans are kinda useless, because its so easy to change your IP address and MAC...

But they do help...
 
Banned
Banned
Joined
Apr 10, 2008
Messages
1,295
Reaction score
113
Re: [Release] !ban <charname>

Wow, right when i request this! Thank you so much dude. xD
 
Newbie Spellweaver
Joined
Aug 21, 2006
Messages
36
Reaction score
0
Re: [Release] !ban <charname>

Code:
------ Build started: Project: MapleStoryServer, Configuration: Release Win32 ------
Compiling...
BeginnerHelper.cpp
MySQLM.cpp
.\MySQLM.cpp(316) : warning C4101: 'mres' : unreferenced local variable
.\MySQLM.cpp(317) : warning C4101: 'mrow' : unreferenced local variable
.\MySQLM.cpp(332) : warning C4244: 'initializing' : conversion from 'my_ulonglong' to 'int', possible loss of data
.\MySQLM.cpp(352) : warning C4244: 'initializing' : conversion from 'my_ulonglong' to 'int', possible loss of data
Players.cpp
.\Players.cpp(115) : error C2653: 'MySQL' : is not a class or namespace name
.\Players.cpp(115) : error C2653: 'MySQL' : is not a class or namespace name
.\Players.cpp(115) : error C3861: 'Ban': identifier not found
.\Players.cpp(115) : error C3861: 'getID': identifier not found
.\Players.cpp(121) : error C2653: 'MySQL' : is not a class or namespace name
.\Players.cpp(121) : error C2653: 'MySQL' : is not a class or namespace name
.\Players.cpp(121) : error C3861: 'unBan': identifier not found
.\Players.cpp(121) : error C3861: 'getID': identifier not found
Player.cpp
Events.cpp
Login.cpp
Characters.cpp
MapleStoryServer.cpp
FamePacket.cpp
Fame.cpp
.\Fame.cpp(39) : warning C4244: 'initializing' : conversion from 'time_t' to 'int', possible loss of data
Build log was saved at "file://c:\Documents and Settings\iFox\Desktop\MapleStory Server\Michel Re[p]ack\Kryticalv6\MapleStoryServer\Release\BuildLog.htm"
MapleStoryServer - 8 error(s), 5 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
 
Junior Spellweaver
Joined
Apr 9, 2008
Messages
188
Reaction score
0
Re: [Release] !ban <charname>

You gonna give credits to Benjoo for being the REAL coder of that snippet or what?
 
Junior Spellweaver
Joined
Mar 22, 2008
Messages
139
Reaction score
5
Re: [Release] !ban <charname>

You gonna give credits to Benjoo for being the REAL coder of that snippet or what?

I though I had it in the code....hold on...sorry bout that
 
Junior Spellweaver
Joined
Apr 9, 2008
Messages
188
Reaction score
0
Re: [Release] !ban <charname>

Sorry i'm just a lil chronic over Credits, when codes being used without credits it makes people leave forums =\
 
Junior Spellweaver
Joined
Mar 22, 2008
Messages
139
Reaction score
5
Re: [Release] !ban <charname>

Sorry i'm just a lil chronic over Credits, when codes being used without credits it makes people leave forums =\

I know what you mean,

btw, you think you could help me out with GM Hide, I'm trying to make it where people cant use /find on you whenever you are in hide mode...
 
Newbie Spellweaver
Joined
Jan 8, 2006
Messages
19
Reaction score
0
Re: [Release] !ban <charname>

I think it's rather useful to just skip /find when using on game masters.
 
Junior Spellweaver
Joined
Mar 22, 2008
Messages
139
Reaction score
5
Re: [Release] !ban <charname>

I think it's rather useful to just skip /find when using on game masters.

I've been trying to do that but i cant figure it out, I know its something really simple...
 
Newbie Spellweaver
Joined
Jan 8, 2006
Messages
19
Reaction score
0
Re: [Release] !ban <charname>

just use the if player isgm statement
 
Status
Not open for further replies.
Back
Top