Difference between revisions of "Clif Displaymessage"

From Hercules Wiki
Jump to: navigation, search
(Created page with "==Syntax== int '''clif_displaymessage'''(const int fd, const char* mes); ==Parameters== * '''fd''' - Socket descriptor (connection handle) for the connection to send the tex...")
 
m (Example)
 
Line 10: Line 10:
  
 
==Example==
 
==Example==
  clif_displaymessage(sd->fd, "Character not found.");
+
  clif->displaymessage(sd->fd, "Character not found.");
 
Would display "Character not found." above sd's head. Same thing can also be accomplished (and preferred) by using [[msg_txt]] function:
 
Would display "Character not found." above sd's head. Same thing can also be accomplished (and preferred) by using [[msg_txt]] function:
  clif_displaymessage(sd->fd, msg_txt(3));
+
  clif->displaymessage(sd->fd, msg_txt(3));
  
 
[[Category:Source Functions]]
 
[[Category:Source Functions]]

Latest revision as of 05:21, 25 September 2013

Contents

Syntax

int clif_displaymessage(const int fd, const char* mes);

Parameters

  • fd - Socket descriptor (connection handle) for the connection to send the text to.
  • mes - Text to send to the client.

Description

Sends a text to the client, which is displayed like normal self-chat (green font in chat and above characters head. Message is only visible to the client, it was sent to. Usually this function is used for at-command output.

Example

clif->displaymessage(sd->fd, "Character not found.");

Would display "Character not found." above sd's head. Same thing can also be accomplished (and preferred) by using msg_txt function:

clif->displaymessage(sd->fd, msg_txt(3));