Hi, I am leaving you today with a question regarding the intrusion into the chat. I know that a lot of people have already done and I'm thinking how to do it.
An example of honey for cyanating messages: Auri: Hi,Forum SAMP, how are you? After connecting to the screen < surprised > to show us in progress, which will just look. Auri: Hi,Forum SAMP, < surprised > how are you? Can anyone help me with this? |
new name[MAX_PLAYER_NAME], string[228];// define the needed variables
GetPlayerName(playerid, name, sizeof(name));// Getting the players name
format(string, sizeof(string), "Hi, FORUM SAMP, %s how are you today", name);// Inserting the players name into the message
//%s is used to input strings, so the player name is a string and it would be inputted there.
SendClientMessage(playerid,0xFFFF00FF, string); // Sending the message to the player with his/her name inserted in it
new str[20] = "Hi <smiles> Sir." strreplace(str, "<", "{FF0000}<"); strreplace(str, ">", ">{FFFF00}"); SendClientMessage(playerid, 0xFFFF00FF, str); //This Will output,
If you want the brackets to appear as same color as other text and only the emote inside the brackets to be different color, then just adjust the position of color inside strreplace.
|
text[0] = toupper(text[0]); new str[170]; strreplace (text, "<", "{FF0000} <"); strreplace (text, ">", ">"); if(CharacterInfo[playerid][pAdminDuty]) { new name[64]; switch(CharacterInfo[playerid][pAdmin]) { case 1: format(name, sizeof(name), "{E6E6E6}%s ({FF9900}Support{E6E6E6})", CharacterInfo[playerid][pGlobalNick]); case 2,3,4: format(name, sizeof(name), "{E6E6E6}%s ({8B00B0}GameMaster{E6E6E6})", CharacterInfo[playerid][pGlobalNick]); case 5,6: format(name, sizeof(name), "{E6E6E6}%s ({B00000}Administrator{E6E6E6})", CharacterInfo[playerid][pGlobalNick]); } format(str, sizeof(str), "%s: %s", name, text); SendWrappedMessageToPlayerRange(playerid, COLOR_FADE1, COLOR_FADE1, COLOR_FADE1, COLOR_FADE1, COLOR_FADE1, str, 10); } else { if(!(CharacterInfo[playerid][pTog] & TOG_SAY)) ApplyAnimation(playerid, "PED", "IDLE_chat", 1.0, 0, 0, 0, 0, 0); format(str, sizeof(str), "%s say: %s", PlayerName2(playerid), text); SetPlayerChatBubble(playerid, text, 0xDADADAFF, 10.0, 4000); SendWrappedMessageToPlayerRange(playerid, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5, str, 10); }
roleplay.pwn(952) : warning 224: indeterminate array size in "sizeof" expression (symbol "maxlength") roleplay.pwn(953) : warning 224: indeterminate array size in "sizeof" expression (symbol "maxlength")
strreplace (text, "<", "{FF0000} <"); strreplace (text, ">", ">");