[HELP] Admin Duty Color in main chat.
#1

Hi. I have this /aduty script where you go on/off duty. But i want to make it so when you go on duty, your name becomes red in playerlist(tab) and in main chat, and when you go off duty it becomes white again/normal.


Here the is current code:
Code:
CMD:aduty(playerid, params[])
{
    new status[4];
    new name[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE,"You are not authorized to use that command.");
    if(sscanf(params,"s[4]",status))return SendClientMessage(playerid, COLOR_WHITE, "Usage: /aduty [On/Off]");
    if(strcmp(status, "on", true) == 0)
	{
        if(PlayerInfo[playerid][pAdminDuty] == 0)
		{
            PlayerInfo[playerid][pAdminDuty] = 1;
            SetPlayerColor(playerid, COLOR_BAN);
            GetPlayerName(playerid, name, sizeof(name));
            return SendClientMessage(playerid, COLOR_GREEN, "You are now administrator duty {29EB17} On.");
        }
        else return SendClientMessage(playerid, COLOR_OTHER, "You are not off duty administrator.");
    }
    if(strcmp(status, "off", true) == 0)
	{
        if(PlayerInfo[playerid][pAdminDuty] == 1)
		{
            PlayerInfo[playerid][pAdminDuty] = 0;
            SetPlayerColor(playerid, COLOR_WHITE);
            GetPlayerName(playerid, name, sizeof(name));

            return SendClientMessage(playerid, COLOR_GREEN, "You are now administrator duty {EB4C17} Off");
        }
        else return SendClientMessage(playerid, COLOR_OTHER, "You are not a on duty administrator.");
    }

    return 1;
}
Reply


Messages In This Thread
[HELP] Admin Duty Color in main chat. - by Arsham7 - 17.10.2011, 00:24
Re: [HELP] Admin Duty Color in main chat. - by Kingunit - 17.10.2011, 00:31
Re: [HELP] Admin Duty Color in main chat. - by Arsham7 - 17.10.2011, 00:39
Re: [HELP] Admin Duty Color in main chat. - by Arsham7 - 17.10.2011, 01:47
Re: [HELP] Admin Duty Color in main chat. - by Aldo. - 17.10.2011, 01:57
Re: [HELP] Admin Duty Color in main chat. - by Arsham7 - 17.10.2011, 02:05
Re: [HELP] Admin Duty Color in main chat. - by Aldo. - 17.10.2011, 02:17

Forum Jump:


Users browsing this thread: 2 Guest(s)