Chat id what player cant see the message?
#1

Hm what if player cant see the message? if I set it to SendClientMessage
Like something like this


pawn Код:
if(Chat[playerid] == true)
    {
        new string[128];
        format(string,sizeof(string),"(%i) %s: {FFFFFF}%s",playerid, ReturnName(playerid),text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
        if(Chat[playerid] == false) // For the ones who didnt type /chatid
        {
            format(string,sizeof(string),"%s: {FFFFFF}%s",playerid, ReturnName(playerid),text);
            SendClientMessageToAll(GetPlayerColor(playerid), string);
            //SendClientMessage(playerid, -1, string);
        }
    }
    else
    {
        new string[128];
        format(string,sizeof(string),"%s: {FFFFFF}%s",ReturnName(playerid),text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
Reply
#2

You mean you want to send it to everyone on the server but the player?

pawn Код:
SendClientMessageToAllExcept(noplayer, color[], string[])
{
      for(new i; i < MAX_PLAYERS; i++) {
          if(!IsPlayerConnected(i)) continue;
          if(i == playerid) continue;
 
          if(!IsPlayerNPC(i)) SendClientMessage(i, color, string);
      }

      return 1;
}
This loops through online players, makes sure the player is connected, checks if the player equals the player specified and then finally sends the message if the player isn't a NPC.
Reply
#3

i mean like /togglechat now he have (0) Test: -->
if the player didnt /togglechat it will have Test: -->
he will still see the chat message, its something like my code
Reply
#4

PHP код:
new string[128];
if(
Chat[playerid] == true)
{
    
format(string,sizeof(string),"(%i) %s: {FFFFFF}%s",playeridReturnName(playerid),text);
    
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
else
{
    
format(string,sizeof(string),"%s: {FFFFFF}%s",playeridReturnName(playerid),text);
    
SendClientMessageToAll(GetPlayerColor(playerid), string);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)