Gl_chatbubble problem.
#1

Hi,
I have a really weird problem with gl_chatbubble. If i say something in public chat on my server, this happens:

My message: hello and welcome in my server
Display in chat: Sean_Tol Says: (no message, only this!)

Here you have a piece of code:

Код:
[public OnPlayerText(playerid, text[])
{
	 new pname[MAX_PLAYER_NAME];
   GetPlayerName(playerid, pname, sizeof (pname));
	 new Message[256];
	 if(strlen(text) > 128) return 0;
	 
	 new to_others[MAX_CHATBUBBLE_LENGTH+1];
	 new to_me[MAX_CHATBUBBLE_LENGTH+1];
	 
	 format(to_others,MAX_CHATBUBBLE_LENGTH,"%s Says: %s",pname, Message);
	 format(to_me,MAX_CHATBUBBLE_LENGTH,"%s Says: %s",pname, Message);
	 
   SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
   SendClientMessage(playerid,ECHO_COLOR,to_me);
   return 0; // not handled by this script
I don't no where it goes wrong. who can help me?

Greets,
sean5874
Reply
#2

You never set the variable Message to anything.

Remove:

pawn Код:
new Message[256];
Change the lines:

pawn Код:
format(to_others,MAX_CHATBUBBLE_LENGTH,"%s Says: %s",pname, Message);
format(to_me,MAX_CHATBUBBLE_LENGTH,"%s Says: %s",pname, Message);
To:

pawn Код:
format(to_others,MAX_CHATBUBBLE_LENGTH,"%s Says: %s",pname, text);
format(to_me,MAX_CHATBUBBLE_LENGTH,"%s Says: %s",pname, text);
Reply
#3

lol nice catch.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)