SA-MP Forums Archive
SendClientMessage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SendClientMessage (/showthread.php?tid=500298)



SendClientMessage - AroseKhanNiazi - 12.03.2014

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


Re: SendClientMessage - Clad - 12.03.2014

This may be useful


Re: SendClientMessage - 7Ahmad7 - 12.03.2014

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.


Re: SendClientMessage - CuervO - 12.03.2014

Couldn't be simpler:

https://sampwiki.blast.hk/wiki/Loops


Re: SendClientMessage - Matess - 12.03.2014

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");
}



Re: SendClientMessage - CuervO - 12.03.2014

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.


Re: SendClientMessage - AroseKhanNiazi - 12.03.2014

Код:
	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 ??


Re: SendClientMessage - CuervO - 12.03.2014

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 '}'


Re: SendClientMessage - AroseKhanNiazi - 12.03.2014

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



Re: SendClientMessage - AroseKhanNiazi - 13.03.2014

??