Coloring Chat - 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: Coloring Chat (
/showthread.php?tid=449864)
Coloring Chat -
arjanforgames - 10.07.2013
pawn Код:
CMD:global(playerid, params[])
{
new msg[128];
if(!sscanf(params, "s", msg))
{
if(PlayerInfo[playerid][pOOCMuted] == 0)
{
if(PlayerInfo[playerid][pAdmin] == 0)
{
new string[128];
format(string, sizeof(string), "(Global) %s %s says: %s", PlayerStatus(playerid), pName, msg);
SendClientMessage(playerid, COLOR_WHITE, msg);
}
}
}
return 1;
}
stock PlayerStatus(playerid)
{
new status[64];
if(PlayerInfo[playerid][pAdmin] == 0) return status = "Player";
if(PlayerInfo[playerid][pAdmin] == 1) return status = "Helper";
if(PlayerInfo[playerid][pAdmin] == 2) return status = "Moderator";
if(PlayerInfo[playerid][pAdmin] == 3) return status = "Administrator";
return status;
}
How can I make this:
(Global)
Player arjanforgames says: Hi
(Global)
Helper arjanforgames says: Hi
If you can help me with that I can make the rest myself.
Re: Coloring Chat -
Misiur - 10.07.2013
http://forum.sa-mp.com/showpost.php?...97&postcount=4
pawn Код:
//Change
format(string, sizeof(string), "(Global) %s %s says: {%s}%s", Statuses[STATUS][statusName], pName, Statuses[STATUS][statusColour], msg);
//to
format(string, sizeof(string), "(Global) {%s}%s{FFFFFFFF} %s says: %s", Statuses[STATUS][statusName], pName, Statuses[STATUS][statusColour], msg);
Re: Coloring Chat -
SwisherSweet - 10.07.2013
Put thesr {} in between texts for example Global {FFFFFF} Helper
Re: Coloring Chat -
Abreezy - 10.07.2013
I like switches for example :
pawn Код:
CMD:global(playerid, params[])
{
new msg[128], string[128], pName;
if(!sscanf(params, "s", msg))
{
if(PlayerInfo[playerid][pOOCMuted] == 0)
{
switch(PlayerInfo[playerid][pAdmin])
{
case 0: // Player
{
format(string, sizeof(string), "(Global) {00FF22}Player {FFFFFF}%s says %s", pName, msg);
}
case 1: // Helper
{
}
}
SendClientMessage(playerid, COLOR_WHITE, msg);
}
}
return 1;
}
Just need to get the color codes and format them