Set admin Color green in chat log.
#1

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;
}
Reply
#2

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!!!
Reply
#3

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
Reply
#4

[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 ?))
Reply
#5

Код:
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;
}
Reply
#6

Okay ill try this.
Reply
#7

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+
Reply
#8

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
Reply
#9

Okay thanks ill try this now..
Reply
#10

Thanks it worked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)