Help +REP
#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


Messages In This Thread
Help +REP - by Nirzor - 01.06.2012, 16:37
Re: Help +REP - by Menaz - 01.06.2012, 16:40
Re: Help +REP - by ViniBorn - 01.06.2012, 16:41
Re: Help +REP - by Sandiel - 01.06.2012, 16:42
Re: Help +REP - by Nirzor - 01.06.2012, 16:47

Forum Jump:


Users browsing this thread: 1 Guest(s)