How to set Players Color?
#1

How do i set the admins On Duty Color to be Orange.?
Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You arent an admin!");
	if(PlayerInfo[playerid][pAdminDuty] == 0)
	{

		SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
		//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
		PlayerInfo[playerid][pAdminDuty] = 1;
		SetPlayerHealth(playerid, 100000);
		SetPlayerArmour(playerid, 100000);
		//SetPlayerSkin(playerid, 294); - Commented by Voltage
		new string[128];
		format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid));
		SendClientMessageToAllEx(COLOR_YELLOW, string);
	}
	else
	{
			SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
			//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 0);
			//SetPlayerSkin(playerid, 299); - Commented by Voltage
			PlayerInfo[playerid][pAdminDuty] = 0;
	}
    return 1;
}
Reply
#2

Try this
pawn Код:
CMD:aduty(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You arent an admin!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {

        SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
        //SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
        PlayerInfo[playerid][pAdminDuty] = 1;
        SetPlayerHealth(playerid, 100000);
        SetPlayerArmour(playerid, 100000);
        //SetPlayerSkin(playerid, 294); - Commented by Voltage
        SetPlayerColour(playerid,0xFF8040C8);
        new string[128];
        format(string, sizeof(string), "Administrator %s is now on Admin Duty! (/report for assistance)", GetPlayerNameEx(playerid));
        SendClientMessageToAllEx(COLOR_YELLOW, string);
    }
    else
    {
            SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
            //SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 0);
            //SetPlayerSkin(playerid, 299); - Commented by Voltage
            PlayerInfo[playerid][pAdminDuty] = 0;
    }
    return 1;
}
Reply
#3

LOL But u for got to add SetPlayerColor(playerid , 0xFFFFFFAA) To be again white after getting Off Duty
Reply
#4

Quote:
Originally Posted by Imperor
Посмотреть сообщение
LOL But u for got to add SetPlayerColor(playerid , 0xFFFFFFAA) To be again white after getting Off Duty
You asked how to change color when he will go on duty.
Reply
#5

Just add a SetPlayerColor(playerid, //COLOR); where he /aduty's from, then SetPlayerColor(playerid, //COLOR); back to the original color.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)