admin color to /b (zGaming Gameode)
#1

How I can set a color to admins on duty this is the command of /b:

Quote:

CMD:b(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /b [text] (Local OOC Chat)");
if(AntiAdv(playerid, params)) return 1;
//format(string, sizeof(string), "(( %s Says: %s ))", RPN(playerid), params);
format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, RPN(playerid), params);
SendNearbyMessage(playerid, 10, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
Log("logs/chat.log", string);
return 1;
}

Reply
#2

Код:
CMD:b(playerid, params[])
	{
		new string[128];
		if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
		if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /b [text] (Local OOC Chat)");
		if(AntiAdv(playerid, params)) return 1;
		format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, RPN(playerid), params);
		if(IsPlayerAdmin(playerid))
		{
			SendNearbyMessage(playerid, 10, string, ADMIN_COLOR1, ADMIN_COLOR2, ADMIN_COLOR3, ADMIN_COLOR4, ADMIN_COLOR5);
		}
		else
		{
		    SendNearbyMessage(playerid, 10, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
		}
		Log("logs/chat.log", string);
		return 1;
	}
Reply
#3

still not working.
Reply
#4

it's for admins- if(PlayerInfo[playerid][pAdmin] < 1)
it's for admins on duty - if(!aDuty[playerid])
Reply
#5

pawn Код:
#define COLOR_ADMIN 0xFFFFFFFF // Define your Admin Color here.


CMD:b(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /b [text] (Local OOC Chat)");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, RPN(playerid), params);
   
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(aDuty[playerid])
        {
            SendNearbyMessage(playerid, 10, string, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN);
        }
    }
    else
    {
        SendNearbyMessage(playerid, 10, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    }
    Log("logs/chat.log", string);
    return 1;
}
Reply
#6

Now it's working with color to /aduty but if you aren't on aduty you cant write something at /b
Reply
#7

pawn Код:
CMD:b(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    new string[128];
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /b [text] (Local OOC Chat)");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, RPN(playerid), params);
    if(PlayerInfo[playerid][pAdmin] >= 1 && aDuty[playerid]) SendNearbyMessage(playerid, 10, string, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN);
    else SendNearbyMessage(playerid, 10.0, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    Log("logs/chat.log", string);
    return 1;
}
Reply
#8

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
pawn Код:
CMD:b(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    new string[128];
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /b [text] (Local OOC Chat)");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, RPN(playerid), params);
    if(PlayerInfo[playerid][pAdmin] >= 1 && aDuty[playerid]) SendNearbyMessage(playerid, 10, string, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN, COLOR_ADMIN);
    else SendNearbyMessage(playerid, 10.0, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    Log("logs/chat.log", string);
    return 1;
}
Try it.
Reply
#9

Working thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)