Help +REP
#1

How will i make an admin command like /onduty /offduty so admins can be on and off duty
Reply
#2

which admin system you are using ?
Reply
#3

pawn Код:
new bool:Duty[MAX_PLAYERS];

//OnPlayerConnect
Duty[playerid] = false;



//   Command  /duty
if(Duty[playerid])
    Duty[playerid] = false;
else
    Duty[playerid] = true;
Reply
#4

Place this in the OnPlayerConnect callback
Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
{
      PlayerInfo[playerid][pAdminDuty] = 0;
}
Command using ZCMD
Код:
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;
}
Glad to help.
Reply
#5

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)