SA-MP Forums Archive
Set admin Color green in chat log. - 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: Set admin Color green in chat log. (/showthread.php?tid=579397)



Set admin Color green in chat log. - shaquill - 26.06.2015

Hey i been stuck on this for a lil while and really want it for my RP server. Okay so I want it to be when a Admin go on duty it sets there name green over /b (Local OOC chat) So when a admin get a report and they spec someone they can be like

"(([12]Bob_Smith: Why did you killl Jason ?))"

And the admin name is Green In the Local OOC chat... How do I do this ?

Код:
CMD:b(playerid, params[])
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}
	if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
	new string[128];
	format(string, sizeof(string), "%s: (( %s ))", GetPlayerNameEx(playerid), params);
	ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
	
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 2)
	    {
			new szAntiprivacy[128];
			format(szAntiprivacy, sizeof(szAntiprivacy), "(BE) %s: %s", GetPlayerNameEx(playerid), params);
			SendClientMessageEx(i, COLOR_GREEN, szAntiprivacy);
		}
	}
	return 1;
}



Re: Set admin Color green in chat log. - Alex Magaсa - 26.06.2015

On Top Of Gamemode:
Код:
#define COLOR_USAGE 	0x00FF00		//{00FF00}
Код:
CMD:b(playerid, params[])
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}
	if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
	new string[128];
	format(string, sizeof(string), "{00FF00}%s: (( {FFFFFF}%s ))", GetPlayerNameEx(playerid), params);
	ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
	
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 2)
	    {
			new szAntiprivacy[128];
			format(szAntiprivacy, sizeof(szAntiprivacy), "(BE) {0000FF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
			SendClientMessageEx(i, COLOR_GREEN, szAntiprivacy);
		}
	}
	return 1;
}
Another example:
{0000FF}Blue: {FFFFFF} Hello!!!


Re: Set admin Color green in chat log. - baba1234 - 26.06.2015

Put under /b command this
if(PlayerInfo[playerid][pAdmin] == 1)
{
SetPlayerColor(playerid, 0xFF0000FF);//put green color here or wathever color u want to show
}else
{
SetPlayerColor(playerid, 0xFF0000FF);//put the default color of occ chat
}
And thats it if u still dont understnd pm me if u want to show this text only when admin is on duty replace PlayerInfo[playerid][pAdmin] == 1 with your AdminOnDuty variable that saves like AdminOnDuty == 1


Re: Set admin Color green in chat log. - shaquill - 27.06.2015

[quote=Alex Magaсa;3502679]On Top Of Gamemode:
Код:
#define COLOR_USAGE 	0x00FF00		//{00FF00}
Код:
CMD:b(playerid, params[])
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}
	if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
	new string[128];
	format(string, sizeof(string), "{00FF00}%s: (( {FFFFFF}%s ))", GetPlayerNameEx(playerid), params);
	ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
	
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 2)
	    {
			new szAntiprivacy[128];
			format(szAntiprivacy, sizeof(szAntiprivacy), "(BE) {0000FF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
			SendClientMessageEx(i, COLOR_GREEN, szAntiprivacy);
		}
	}
	return 1;
}
Thanks but not exactly what i was asking for.. Im more asking for like when you go off duty the green go back to white and when you get on duty it go to Dark Green.. And yours looked like this in game Jon: ((Test)) <Kinda looks bugged... I dont want it like that aha I want it like this (([12]Bob_Smith: Why did you killl Jason ?))


Re: Set admin Color green in chat log. - Alex Magaсa - 27.06.2015

Код:
CMD:b(playerid, params[])
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}
	if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
	new string[128];
	format(string, sizeof(string), "(({00FF00}%s:  {FFFFFF}%s ))", GetPlayerNameEx(playerid), params);
	ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
	
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 2)
	    {
			new szAntiprivacy[128];
			format(szAntiprivacy, sizeof(szAntiprivacy), "(BE) {0000FF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
			SendClientMessageEx(i, COLOR_GREEN, szAntiprivacy);
		}
	}
	return 1;
}



Re: Set admin Color green in chat log. - shaquill - 29.06.2015

Okay ill try this.


Re: Set admin Color green in chat log. - shaquill - 30.06.2015

Quote:
Originally Posted by Alex Magaсa
Посмотреть сообщение
Код:
CMD:b(playerid, params[])
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}
	if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
	new string[128];
	format(string, sizeof(string), "(({00FF00}%s:  {FFFFFF}%s ))", GetPlayerNameEx(playerid), params);
	ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
	
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 2)
	    {
			new szAntiprivacy[128];
			format(szAntiprivacy, sizeof(szAntiprivacy), "(BE) {0000FF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
			SendClientMessageEx(i, COLOR_GREEN, szAntiprivacy);
		}
	}
	return 1;
}
Okay the code works good only one problem.. It sets all players name over /b to be green I dont want that.. I want it to be only admins names is green over /b OOC chat.. Please fix for me ill rep+


Re: Set admin Color green in chat log. - Roko_foko - 30.06.2015

instead of line :
Код:
//line 10
format(string, sizeof(string), "(({00FF00}%s:  {FFFFFF}%s ))", GetPlayerNameEx(playerid), params);
put this:
Код:
if (player is admin) // check comment1 bellow
    format(string, sizeof(string), "(({00FF00}%s:  {FFFFFF}%s ))", GetPlayerNameEx(playerid), params);
else 
    format(string, sizeof(string), "((%s:  %s ))", GetPlayerNameEx(playerid), params);
comment1: checking if player is an admin depends on your script, from the code you have given I think this is good checking:

Код:
if(PlayerInfo[i][pAdmin] >= 1)
hope it helped


Re: Set admin Color green in chat log. - shaquill - 30.06.2015

Okay thanks ill try this now..


Re: Set admin Color green in chat log. - shaquill - 30.06.2015

Thanks it worked!