SendClientMessage
#1

How do i make a message that will send the message to everyone expect the target it
Reply
#2

This may be useful
Reply
#3

just use this function

pawn Код:
// Send a message to everyone.
        SendClientMessageToAll(-1, "add this line under any command you want it say something for all.");
    return 0;

+rep me if i helped you.
Reply
#4

Couldn't be simpler:

https://sampwiki.blast.hk/wiki/Loops
Reply
#5

Well i think he doesnt't want to send a message to all, but "all-1".

Try something like this:

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
   if(blocked[i] == 1) continue;
   SendClientMessage(playerid, -1, "This text is white");
}
Reply
#6

Quote:
Originally Posted by Matess
Посмотреть сообщение
Well i think he doesnt't want to send a message to all, but "all-1".

Try something like this:

pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
   if(blocked[i] == 1) continue;
   SendClientMessage(playerid, -1, "This text is white");
}
pawn Код:
SendMessageToAllBut(playerid, color, const text[])
{
   for(new i = 0; i < MAX_PLAYERS; i ++)
   {
      if(!IsPlayerConnected(i)) continue;
      if(playerid == i) continue;

      SendClientMessage(i, color, text);
   }
}
No need to use variables.
Reply
#7

Код:
	SendMessageToAllBut(playerid, color, const str[])
	{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
      if(!IsPlayerConnected(i)) continue;
      if(playerid == i) continue;

      SendClientMessage(i, -1, stri);
    }
   	TextDrawShowForAllBut(playerid, const str1[])
	{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
      if(!IsPlayerConnected(i)) continue;
      if(playerid == i) continue;

      TextDrawSetString(Textdraw222, str1);
      TextDrawShowForPlayer(i,Textdraw222);
    }
like this and i know how to SendClientMessageToAll and SendClientMessage at last read it full and Thanks anyway.
Matess and CuervO will it work like this ??
Reply
#8

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
Код:
	SendMessageToAllBut(playerid, color, const str[])
	{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
      if(!IsPlayerConnected(i)) continue;
      if(playerid == i) continue;

      SendClientMessage(i, -1, stri);
    }
   	TextDrawShowForAllBut(playerid, const str1[])
	{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
      if(!IsPlayerConnected(i)) continue;
      if(playerid == i) continue;

      TextDrawSetString(Textdraw222, str1);
      TextDrawShowForPlayer(i,Textdraw222);
    }
like this and i know how to SendClientMessageToAll and SendClientMessage at last read it full and Thanks anyway.
Matess and CuervO will it work like this ??
Yes it will work, however, you can keep the TextDrawSetString out of the loop as you only need to set the string once. Also I hope it was intentional but you're missing two closing brackets '}'
Reply
#9

it says undfined Symbol SendMessageToAllBut

Код:
: error 017: undefined symbol "SendMessageToAllBut"
 error 029: invalid expression, assumed zero
 error 029: invalid expression, assumed zero
 fatal error 107: too many error messages on one line
Reply
#10

??
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)