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