Jump to content
  • 0

How to send a message to all online characters in their messagebox


Question

Posted (edited)

I noob in source editting but i just want to ask how to send a message to all online characters in their message box

example is: I request a trade... It will display a message to all online chars that "User A request a trade on User B". I think clif_displaymessage(sd->fd,target_sd->status.name) cant do that. I found this clif_GlobalMessage

Thanks in advance.

Edited by JayPeeMateo

7 answers to this question

Recommended Posts

  • 0
Posted

I think you could avoid a source edit (If you are running an SQL based server) just use a query to loop through all members, if they are online, it will message them.

*Note: In the query you can recall the characters ID, name etc for certain things like:

*message "<character name>","<message>";

or

*isloggedin(<account id>{,<char id>})

  • 0
Posted

I came up with this code, is this correct?:

trade.c

char output[200];

void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd)
  int level;
  int targetLevel;

   level = pc_isGM(sd);
   targetLevel = pc_isGM(target_sd);

  if((level>=60) && (targetLevel<=20))
  {
        sprintf(output, msg_txt(904), sd->status.name, target_sd->status.name);
      clif_broadcast(&sd->bl, output, strlen(output) + 1, 0, ALL_CLIENT);
  }
}

msg_athena.conf


  904: %s request a trade to %s

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...