01.06.2012, 16:37
How will i make an admin command like /onduty /offduty so admins can be on and off duty

new bool:Duty[MAX_PLAYERS];
//OnPlayerConnect
Duty[playerid] = false;
// Command /duty
if(Duty[playerid])
Duty[playerid] = false;
else
Duty[playerid] = true;
if(PlayerInfo[playerid][pAdmin] >= 1) { PlayerInfo[playerid][pAdminDuty] = 0; }
CMD:aduty(playerid, params[]) { new pName[MAX_PLAYER_NAME]; new string[128]; if(PlayerInfo[playerid][pAdmin] >= 1) { if(PlayerInfo[playerid][pAdminDuty] == 1) { PlayerInfo[playerid][pAdminDuty] = 1; SetPVarInt(playerid, "LastSkin", GetPlayerSkin(playerid)); SetPlayerSkin(playerid, 294); SetPlayerColor(playerid, COLOR_LIGHTBLUE); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "** Administrator %s is now on admin duty. **", pName); for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pAdmin] >= 1) { SendClientMessage(i, COLOR_YELLOW, string); } } } else if(PlayerInfo[playerid][pAdminDuty] == 0) { PlayerInfo[playerid][pAdminDuty] = 0; SetPlayerSkin(playerid, GetPVarInt(playerid, "LastSkin")); SetPlayerColor(playerid, COLOR_WHITE); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "** Administrator %s is now off admin duty. **", pName); for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pAdmin] >= 1) { SendClientMessage(i, COLOR_YELLOW, string); } } } } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not authorized to use this feature ::."); return 1; }