17.10.2011, 00:24
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:
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;
}

