Junior Spellweaver
- Joined
- Mar 22, 2008
- Messages
- 139
- Reaction score
- 5
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);
}
static void Ban(int UserName);
static void UnBan(int UserName);
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);
}
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 =)
------ 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 ==========
You gonna give credits to Benjoo for being the REAL coder of that snippet or what?
Sorry i'm just a lil chronic over Credits, when codes being used without credits it makes people leave forums =\
I think it's rather useful to just skip /find when using on game masters.