15.10.2011, 06:39
Hello,
What I would like to know, which I figure this is very simple but I have no idea what the line would write out as.
I want to know how to change the color of an admins name when he/she goes onto admin duty.
EX: If I got on adminduty, I would like my name to show up as RED when I am on adminduty and the normal white when I am off, so that players know who is on admin duty.
Anyone care you help?
At the moment my aduty command looks like this:
What I would like to know, which I figure this is very simple but I have no idea what the line would write out as.
I want to know how to change the color of an admins name when he/she goes onto admin duty.
EX: If I got on adminduty, I would like my name to show up as RED when I am on adminduty and the normal white when I am off, so that players know who is on admin duty.
Anyone care you help?
At the moment my aduty command looks like this:
Код:
command(aduty, playerid, params[])
{
#pragma unused params
new string[128];
if(Player[playerid][AdminLevel] >= 1) {
if(Player[playerid][AdminDuty] == 0) {
if(strlen(Player[playerid][AdminName]) >= 1 || strcmp(Player[playerid][AdminName], "Nothing", true) == 0) {
SendClientMessage(playerid, WHITE, "You are now on admin duty.");
Player[playerid][AdminDuty] = 1;
if(Player[playerid][AdminLevel] >= 3) {
SetPlayerHealth(playerid, 500000);
}
SetPlayerSkin(playerid, Player[playerid][AdminSkin]);
if(Player[playerid][HospitalTime] >= 1) {
Player[playerid][HospitalTime] = 0;
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, SpawnX, SpawnY, SpawnZ);
SetPlayerDrunkLevel(playerid, 0);
SendClientMessage(playerid, WHITE, "You have been de-hospitalized.");
}
format(string, sizeof(string), "%s is now on Admin Duty.", Player[playerid][NormalName]);
SendToAdmins(ADMINORANGE, string, 0);
}
else {
SendClientMessage(playerid, WHITE, "You haven't set an administrators' name yet.");
}
}
else {
SendClientMessage(playerid, WHITE, "You're now off admin duty, though you will still see admin chat.");
Player[playerid][AdminDuty] = 0;
SetPlayerColor(playerid, WHITE);
if(Player[playerid][AdminLevel] >= 3) {
SetPlayerHealth(playerid, 100);
}
if(strlen(Player[playerid][NormalName]) > 1) {
SetPlayerName(playerid, Player[playerid][NormalName]);
}
SetPlayerSkin(playerid, Player[playerid][LastSkin]);
format(string, sizeof(string), "%s is now off Admin Duty.", GetName(playerid));
SendToAdmins(ADMINORANGE, string, 0);
}
}
return 1;
}

