PDA

View Full Version : Local chat command for special


DemME
01/11/2016, 03:20 AM
Alrighty so in LS-RP it marks the administrator's names whenever they are using PMs or /b (local chat).
How they do so, I know that you need to define whenever the admin is blah blah blah, but every time that I do so It doubles the chat instead of doing it to one chat.


CMD:b(playerid, params[])
{
new str[200];
if(sscanf(params, "s[200]", str)) return SendClientMessage(playerid, COLOR_GRAY, "/b [message]");

format(str, sizeof(str), "(( %s: %s ))", GetRoleplayName(playerid), str);
SendLocalMessage(playerid, str,Range_Normal, COLOR_LBLUE, COLOR_LBLUE);
SetPlayerChatBubble(playerid, str, COLOR_LBLUE, Range_Normal, 7000);

return 1;
}




CMD:pm(playerid, params[])
{
new pID, pmmsg[200], str[200];
if(sscanf(params, "us[200]", pID, pmmsg)) return SendClientMessage(playerid, COLOR_GRAY, "/pm [playerid] [message]");
format(str, sizeof(str), "[PM from [%d] %s]: %s", playerid, GetRoleplayName(playerid), pmmsg);
SendSplitMessage(pID, COLOR_YELLOW, str);

format(str, sizeof(str), "[PM to [%d] %s]: %s", pID, GetRoleplayName(pID), pmmsg);
SendSplitMessage(playerid, COLOR_YELLOW, str);
return 1;
}


Dont get what I'm saying? watch this screenie: http://prntscr.com/d1io4l

jbankss
01/11/2016, 04:00 AM
I think what you're looking for is color embedding.
If that is the case - http://wiki.sa-mp.com/wiki/Colour_Embedding

One way of doing it:

New color[12]
If(isadmin(sender)) color = "FFFFFF" // admim color
else color = "FFFFFF" // regular chat color
format(message, sizeof(message), "pm from {%s}%s{FFFFFF}: %s", color, getname(..), text); // the {FFFFFF} oughtha be replaced w/ the actual pm color


Wrote this on my phone

You can get the hex-colors here: http://www.colorpicker.com/

DemME
01/11/2016, 04:03 AM
I think what you're looking for is color embedding.
If that is the case - http://wiki.sa-mp.com/wiki/Colour_Embedding

One way of doing it:

New color[12]
If(isadmin(sender)) color = "FFFFFF" // admim color
else color = "FFFFFF" // regular chat color
format(message, sizeof(message), "pm from {%s}%s{FFFFFF}: %s", color, getname(..), text); // the {FFFFFF} oughtha be replaced w/ the actual pm color


Wrote this on my phone

You can get the hex-colors here: http://www.colorpicker.com/
Exactly, thanks mate :)

DemME
01/11/2016, 04:39 AM
I think what you're looking for is color embedding.
If that is the case - http://wiki.sa-mp.com/wiki/Colour_Embedding

One way of doing it:

New color[12]
If(isadmin(sender)) color = "FFFFFF" // admim color
else color = "FFFFFF" // regular chat color
format(message, sizeof(message), "pm from {%s}%s{FFFFFF}: %s", color, getname(..), text); // the {FFFFFF} oughtha be replaced w/ the actual pm color


Wrote this on my phone

You can get the hex-colors here: http://www.colorpicker.com/

nvm fixed

DemME
01/11/2016, 04:55 PM
I think what you're looking for is color embedding.
If that is the case - http://wiki.sa-mp.com/wiki/Colour_Embedding

One way of doing it:

New color[12]
If(isadmin(sender)) color = "FFFFFF" // admim color
else color = "FFFFFF" // regular chat color
format(message, sizeof(message), "pm from {%s}%s{FFFFFF}: %s", color, getname(..), text); // the {FFFFFF} oughtha be replaced w/ the actual pm color


Wrote this on my phone

You can get the hex-colors here: http://www.colorpicker.com/

Not working, returning the same.