ogremagi Posted September 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 11 Reputation: 0 Joined: 08/09/12 Last Seen: November 1, 2012 Share Posted September 15, 2012 Hi! I would like to request a command for @mainblock {charactername/ID} which will block the character for using @main until the server restart again. so if the block character tried to use @main again, it will displayed, you've been banned for using @main. Thank you in advance! Quote Link to comment Share on other sites More sharing options...
lekkereten Posted September 15, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 148 Reputation: 46 Joined: 11/02/11 Last Seen: November 25, 2024 Share Posted September 15, 2012 src/map/pc.h find: unsigned int warping : 1;//states whether you're in the middle of a warp processing add after: unsigned int main_blacklisted : 1; src/map/map.c find: party_booking_delete(sd); // Party Booking [spiria] add before: if(sd->state.main_blacklisted) { sd->state.main_blacklisted = 0; } src/map/atcommand.c find: ACMD_FUNC(main) { add after: if (sd->state.main_blacklisted) { clif_displaymessage(fd, "You have been banned for using @main."); return -1; } find: ACMD_FUNC(main) add before: ACMD_FUNC(mainblock) { struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); if (!message || !*message) { clif_displaymessage(fd, "Please enter a player name (usage: @mainblock <char name/ID>)."); return -1; } if ((pl_sd = map_nick2sd((char *)message)) == NULL && (pl_sd = map_charid2sd(atoi(message))) == NULL) { clif_displaymessage(fd, msg_txt(3)); // Character not found. return -1; } if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { clif_displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player. return -1; } if (pl_sd->state.main_blacklisted == 0) { pl_sd->state.main_blacklisted = 1; clif_displaymessage(fd, "Blocked @main for character!"); } else { clif_displaymessage(fd, "Character is already blocked!"); } return 0; } find: ACMD_DEF(main), add before: ACMD_DEF(mainblock), If you want to toggle the ban on @mainblock, do this: find: clif_displaymessage(fd, "Character is already blocked!"); change to: pl_sd->state.main_blacklisted = 0; clif_displaymessage(fd, "Character unblocked!"); 1 Quote Link to comment Share on other sites More sharing options...
ogremagi Posted September 20, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 11 Reputation: 0 Joined: 08/09/12 Last Seen: November 1, 2012 Author Share Posted September 20, 2012 Thanks! it works 100% however, how about adding time just like using @jailfor? for example, @mainblock 1h charactername, it will block the main commands of charactername for an hour. Quote Link to comment Share on other sites More sharing options...
Question
ogremagi
Hi! I would like to request a command for @mainblock {charactername/ID} which will block the character for using @main until the server restart again.
so if the block character tried to use @main again, it will displayed, you've been banned for using @main.
Thank you in advance!
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.