Jump to content
  • 0

clif_disp_onlyself shows message in green


LordAioria

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  12/31/11
  • Last Seen:  

Hi

I'm using a clif_disp_onlyself command when someone talks. This means that i control if one character belongs to a specific race.

The thing is that it works perfect... the unique problem that i have is that the text is in green color ....

I was thinking that maybe the color was a client problem .... but when i am using ShinsDiffPatcher tool i don't see old xray options that i have used to change alliance text colors , guild text colors etc....

sprintf(atcmd_output, msg_txt(799), emisor, message); // %s: %s

clif_disp_onlyself(tsd,atcmd_output,strlen(atcmd_output));

Any idea about how can i solve it ?

This is the normal code at clif_parse_GlobalMessage :

WFIFOHEAD(fd, 8 + textlen);

WFIFOW(fd,0) = 0x8d;

WFIFOW(fd,2) = 8 + textlen;

WFIFOL(fd,4) = sd->bl.id;

safestrncpy((char*)WFIFOP(fd,8), is_fake ? fakename : text, textlen);

//FIXME: chat has range of 9 only

clif_send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);

The thing is that instead of this .. i'm using a map_foreachinarea .....

and then using this clif_disp_onlyself ....

Could you help me ?

THanks in advance

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

Try this

void clif_display_message_color(struct map_session_data *sd, const char* msg, unsigned long color)
{
int fd;
unsigned short len = strlen(msg) + 1;

nullpo_retv(sd);

fd = sd->fd;
WFIFOHEAD(fd, len+12);
WFIFOW(fd,0) = 0x2C1;
WFIFOW(fd,2) = len+12;
WFIFOL(fd,4) = 0;
WFIFOL(fd,8) = color;
memcpy(WFIFOP(fd,12), msg, len);
WFIFOSET(fd, WFIFOW(fd,2));
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  12/31/11
  • Last Seen:  

Hi thanks for all your help , but i think that maybe i don't explain well the question .....

I'm working on language system ... the thing is that i'm using a clif_disp_onlyself(tsd,atcmd_output,strlen(atcmd_output));

to send to each character that is near to the speaker different messages ..... and example :

You talk : Da

I don't speak russian : I listen : You are ugly!!!

any that speaks russian listen : Da

:) .... the code is working fine and this behaviour is working .. the only thing is that when i'm using this clif_disp_onlyself it always write the text in green .. instead of white... i don't know why ......

Any idea about how can i modify this function or create a new one to solve it?

Thanks in advance!!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  12/31/11
  • Last Seen:  

Any idea about how can i solve it ?

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