Jump to content
  • 0

Blocking playing for using @main


ogremagi

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  08/09/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  148
  • Reputation:   46
  • Joined:  11/02/11
  • Last Seen:  

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!");

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  08/09/12
  • Last Seen:  

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...