Jump to content
  • 0

Making @me command display @fakename instead of real name


Dirpy

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.01
  • Content Count:  4
  • Reputation:   0
  • Joined:  02/04/23
  • Last Seen:  

Hello! 

I would like some help to modify the @me command to make it @fakename friendly, displaying the current display name instead of the real name. I have been trying modifying the command but i cannot seem to make it work, this is the line:

 

Quote

 

ACMD_FUNC(me) {

char tempmes[CHAT_SIZE_MAX]; nullpo_retr(-1, sd);

memset(tempmes, '\0', sizeof(tempmes));

memset(atcmd_output, '\0', sizeof(atcmd_output)); if (sd->sc.cant.chat || (sd->state.block_action & PCBLOCK_CHAT)) return -1; //no "chatting" while muted.

if (!message || !*message || sscanf(message, "%255[^\n]", tempmes) < 0) {

clif_displaymessage(fd, msg_txt(sd,1302)); // Please enter a message (usage: @me <message>).

return -1;

}

sprintf(atcmd_output, msg_txt(sd,270), sd->status.name, tempmes); // *%s %s*

clif_disp_overhead(&sd->bl, atcmd_output);

return 0;

}

The idea is for @me to show @fakename (if there is one enabled) or the current display name instead of the real name of the character.

Still getting the hang of this so i would appreciate the help!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  431
  • Reputation:   164
  • Joined:  12/12/17
  • Last Seen:  

1 hour ago, Dirpy said:

Hello! 

I would like some help to modify the @me command to make it @fakename friendly, displaying the current display name instead of the real name. I have been trying modifying the command but i cannot seem to make it work, this is the line:

 

The idea is for @me to show @fakename (if there is one enabled) or the current display name instead of the real name of the character.

Still getting the hang of this so i would appreciate the help!

Look for this on src/map/atcommand.cpp:

 

/*==========================================
 * @me by lordalfa
 * => Displays the OUTPUT string on top of the Visible players Heads.
 *------------------------------------------*/
ACMD_FUNC(me)
{
	char tempmes[CHAT_SIZE_MAX];
	nullpo_retr(-1, sd);

	memset(tempmes, '\0', sizeof(tempmes));
	memset(atcmd_output, '\0', sizeof(atcmd_output));

	if (sd->sc.cant.chat || (sd->state.block_action & PCBLOCK_CHAT))
		return -1; //no "chatting" while muted.

	if (!message || !*message || sscanf(message, "%255[^\n]", tempmes) < 0) {
		clif_displaymessage(fd, msg_txt(sd,1302)); // Please enter a message (usage: @me <message>).
		return -1;
	}

+	if ( sd->fakename[0] )
+		sprintf(atcmd_output, msg_txt(sd,270), sd->fakename, tempmes);	// *%s %s*
+	else 
		sprintf(atcmd_output, msg_txt(sd,270), sd->status.name, tempmes);	// *%s %s*
	clif_disp_overhead(&sd->bl, atcmd_output);

	return 0;

}

Where the '+' are the lines you need to add incase you didnt know.

Edited by pajodex
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.01
  • Content Count:  4
  • Reputation:   0
  • Joined:  02/04/23
  • Last Seen:  

22 hours ago, pajodex said:

Look for this on src/map/atcommand.cpp:

 

/*==========================================
 * @me by lordalfa
 * => Displays the OUTPUT string on top of the Visible players Heads.
 *------------------------------------------*/
ACMD_FUNC(me)
{
	char tempmes[CHAT_SIZE_MAX];
	nullpo_retr(-1, sd);

	memset(tempmes, '\0', sizeof(tempmes));
	memset(atcmd_output, '\0', sizeof(atcmd_output));

	if (sd->sc.cant.chat || (sd->state.block_action & PCBLOCK_CHAT))
		return -1; //no "chatting" while muted.

	if (!message || !*message || sscanf(message, "%255[^\n]", tempmes) < 0) {
		clif_displaymessage(fd, msg_txt(sd,1302)); // Please enter a message (usage: @me <message>).
		return -1;
	}

+	if ( sd->fakename[0] )
+		sprintf(atcmd_output, msg_txt(sd,270), sd->fakename, tempmes);	// *%s %s*
+	else 
		sprintf(atcmd_output, msg_txt(sd,270), sd->status.name, tempmes);	// *%s %s*
	clif_disp_overhead(&sd->bl, atcmd_output);

	return 0;

}

Where the '+' are the lines you need to add incase you didnt know.

Thank you very much sir! 

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...