Help with admins.
#1

I have the following things.
Quote:

//----------------AOD --------------------------------//
if(strcmp(cmd, "/adminonduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerHealth(playerid,99999);
SetPlayerArmour(playerid,100);
format(string, sizeof(string), "[Info] %s is now on duty as an admin. ", sendername);
SendClientMessageToAll(COLOR_BLUE, string);
SetPlayerColor(playerid, COLOR_YELLOW2); //
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not an Admin !");
}
}
return 1;
}
//----------------AOF // --------------------------------//
if(strcmp(cmd, "/adminoffduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{

GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
format(string, sizeof(string), "[Info] %s is no longer on duty as an admin.", sendername);
SendClientMessageToAll(COLOR_YELLOW2, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not an Admin !");
}
}
return 1;
}

In addition to this CMD,I want an /admins CMD.
Like,if the player types /admins,if the admin is on-duty he will see like " Admin-FreeSoul-3-On Duty" with the color green.Like Admin-PlayerName-AdminLevel-OnDuty.
And if the admin is not on duty he will se like Admin-FreeSoul-3-OffDuty with red.
Can somebody help me with this?
It usually use [pAdmin]
Thanks.
Reply
#2

You don't have any duty variable.
Reply
#3

How can I add it? I need to make a new command?
Reply
#4

new duty[MAX_PLAYERS];

Under your on

duty[playerid] = 1;

and off

duty[playerid] = 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)