Quick question
#1

Alright I got this whisper command

Код:
if(strcmp("/w", cmdtext, true, 2)==0)
	{
  if(strlen(cmdtext) <= 3) {
  SendClientMessage(playerid,COLOR_RED,"USAGE: /w (msg)");
  return 1;
  }
  new output[150];
	new pname[24];
	new string[128];
	GetPlayerName(playerid, pname, 24);
  strmid(output,cmdtext,2,strlen(cmdtext));
  format(string, sizeof(string), "(WHISPER): %s(%d) %s",pname,playerid,output);
  printf("%s", string);
  for(new i=0;i<MAX_PLAYERS;i++)
	{
  if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10) {
	{
  format(string, sizeof(string), "(WHISPER): %s(%d) %s",pname,playerid,output);
  format(string, sizeof(string),
  SendClientMessage(i,COLOR_YELLOW,string);
  }
  }
  }
  return 1;
  }
		
	}
	return 0;
}

Now, how am I going to show the string (message typed by player) above the players character?
Reply
#2

i think with textdraw or something :P
je bent nl he. "De" "Vries"
Reply
#3

Quote:
Originally Posted by dclaw
i think with textdraw or something :P
je bent nl he. "De" "Vries"
Textdraw? Don't think so.

En ja.
Reply
#4

SetPlayerChatBubble
Reply
#5

Thank you.
Reply
#6

I got another question, I'm kinda noob in scripting so..

Now I got this:

Код:
if(strcmp("/w", cmdtext, true, 2)==0)
	{
  if(strlen(cmdtext) <= 3) {
  SendClientMessage(playerid,COLOR_RED,"USAGE: /w (msg)");
  return 1;
  }
  new output[150];
	new pname[24];
	new string[128];
	GetPlayerName(playerid, pname, 24);
  strmid(output,cmdtext,2,strlen(cmdtext));
  format(string, sizeof(string), "(WHISPER): %s(%d) %s",pname,playerid,output);
  SetPlayerChatBubble(playerid, string, COLOR_WHITE, 150.0, 10000);
  printf("%s", string);
  for(new i=0;i<MAX_PLAYERS;i++)
	{
  if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10) {
	{
  format(string, sizeof(string), "(WHISPER): %s(%d) %s",pname,playerid,output);
  SetPlayerChatBubble(playerid, string, COLOR_WHITE, 150.0, 10000);
  SendClientMessage(i,COLOR_YELLOW,string);
  }
  }
  }
  return 1;
  }
		
	}
	return 0;
}
[img width=1024 height=640]http://i46.tinypic.com/j8kx0w.png[/img]

Text above head.. but now in the chat I want to keep (WHISPER): Name(ID) text

and in chatbubble I only want the text, how am I going to do that?

EDIT: Sorry for double post.
Reply
#7

bump. I really need help
Reply
#8

I think this should work:

Код:
if(strcmp("/w", cmdtext, true, 2)==0)
	{
	  if(strlen(cmdtext) <= 3)
		{
	    SendClientMessage(playerid,COLOR_RED,"USAGE: /w (msg)");
	    return 1;
	  }
	  new output[150];
	  new pname[24];
	  new string[128];
	  GetPlayerName(playerid, pname, 24);
	  strmid(output,cmdtext,2,strlen(cmdtext));
	  format(string, sizeof(string), "(WHISPER): %s(%d) %s",pname,playerid,output);
	  SetPlayerChatBubble(playerid, output, COLOR_WHITE, 150.0, 10000);
	  printf("%s", string);
	  for(new i=0;i<MAX_PLAYERS;i++)
		{
	    if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
			{
				format(string, sizeof(string), "(WHISPER): %s(%d) %s",pname,playerid,output);
	      SetPlayerChatBubble(playerid, output, COLOR_WHITE, 150.0, 10000);
	      SendClientMessage(i,COLOR_YELLOW,string);
	    }
  	}
  	return 1;
  	}
Reply
#9

It works now, thanks.
Reply
#10

No problems, if you have any more questions, just ask them
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)