Jump to content

(script_command) whisper


Hyroshima

Recommended Posts


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  189
  • Reputation:   122
  • Joined:  07/11/14
  • Last Seen:  

Allows you to send private messages to a player (char_id), you can use the char_id or a title as the sender.

/** [Hyroshima]
 * whisper <CHAR_ID_TARGET>,<MESSAGE>,<CHAR_ID_SENDER/TITLE>};
 * @return: 0 success, 1 target not found, 2 sender not found.
 **/
BUILDIN_FUNC(whisper){

	map_session_data *ssd,*tsd;
	char message[70] = {0};
	char wisp_title[NAME_LENGTH] = {0};
	uint8 len = strlen(script_getstr(st,3));

	if(!script_charid2sd(2,tsd))
	{
		//Target not found / offline
		script_pushint(st,1);
		return SCRIPT_CMD_SUCCESS;
	}

	if(atoi(script_getstr(st,4)))
	{
		if(!script_charid2sd(4,ssd))
		{
			//Sender not found. / offline
			script_pushint(st,2);
			return SCRIPT_CMD_SUCCESS;
		}
		else
			safestrncpy(wisp_title,ssd->status.name,NAME_LENGTH);
	}
	else
		safestrncpy(wisp_title,script_getstr(st,4),NAME_LENGTH);

	script_pushint(st,0);
	safestrncpy(message,script_getstr(st,3),len);
	clif_wis_message(tsd,wisp_title,message,len,0);

	return SCRIPT_CMD_SUCCESS;
}

 

BUILDIN_DEF(whisper, "is?"), //Hyroshima

Example:

*whisper 150001,"message test","Tester";
*whisper(150001,"message test",150002;

Capturadetela2024-10-14081545.jpg.87f2632e5dddddffdac6afb166ce5a03.jpg

 

A member had asked me if I would do it, I ended up doing it but then he had replied that he had already done it, so I am making available what I did.

  • Upvote 1
  • MVP 1
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
Reply to this topic...

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