Adding ID after players name in chat!
#1

Hello all l have this:
pawn Код:
new to_others[MAX_CHATBUBBLE_LENGTH+1];
        format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
        SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
    }
    {

    new string[128], pname[24];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof (string), "%s[%d]: %s", pname, playerid, text);
        SendClientMessageToAll(0xFFFFFFAA, string);

    }
    return 0;
}
But in chat all players names are white how to change them to their skin colour help pleas?!?!
Reply
#2

pawn Код:
new to_others[MAX_CHATBUBBLE_LENGTH+1];
        format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
        SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
    }
    {

    new string[128], pname[24];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof (string), "%s[%d]: {FFFFFF}%s", pname, playerid, text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);

    }
    return 0;
}
Send the message with the player's color using "GetPlayerColor" and setting the text to white using "{FFFFFF}".
Reply
#3

Might want to check this out to, could be useful in the future and adding the id depending on how you want the end result to look

https://sampwiki.blast.hk/wiki/SendPlayerMessageToAll
Reply
#4

its working thanks but how to set that ID to gray bc l want that colour so the ID would be more visible?
Reply
#5

pawn Код:
new to_others[MAX_CHATBUBBLE_LENGTH+1];
        format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
        SetPlayerChatBubble(playerid,to_others,MESSAGE_COLOR,35.0,10000);
    }
    {

    new string[128], pname[24];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof (string), "%s{C0C0C0}[%d]{FFFFFF}: %s", pname, playerid, text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);

    }
    return 0;
}
Reply
#6

Thanks very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)