SA-MP Forums Archive
Adminduty, hides from /admins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Adminduty, hides from /admins (/showthread.php?tid=126304)



Adminduty, hides from /admins - Chivava - 07.02.2010

Hello can anyone please help me out of this situation.. i got this command /adminduty and i want to make it so it hides the admin from /admins (list)

This is how it looks alike at the moment..
Also how do i remove the player name over their head in this chase ?
Код:
	if(!strcmp(cmdtext, "/adminduty", true)) // By Ellis
	{
		if(IsPlayerConnected(playerid))
		{
		  if(gPlayerLogged[playerid] == 0)
		  {
		    SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
				return 1;
		  }
		  if(PlayerInfo[playerid][pAdmin] > 0)
		  {
		    if(AdminDuty[playerid] == 0)
		    {
		      AdminDuty[playerid] = 1;
		      SetPlayerArmour(playerid, 999);
					SetPlayerHealth(playerid, 999);
					SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes on duty as admin", playerid, sendername);
					ABroadCast(COLOR_YELLOW,string,1);
					if(PlayerInfo[playerid][pAdmin] >= 5)
					{
					  for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		    }
		    else if(AdminDuty[playerid] == 1)
		    {
		      AdminDuty[playerid] = 0;
		      SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,TEAM_HIT_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes off duty as admin", playerid, sendername);
					ABroadCast(COLOR_YELLOW,string,1);
					return 1;
		    }
		  }
		  else
		  {
		    SendClientMessage(playerid, COLOR_GREY, "  You're not the admin !");
		    return 1;
		  }
		}
	  return 1;
	}



Re: Adminduty, hides from /admins - Chivava - 08.02.2010

bump


Re: Adminduty, hides from /admins - ettans - 08.02.2010

Add a check tho the /admins command.

pawn Код:
if(AdminDuty[i] == 0)
{
  // show the admins
}



Re: Adminduty, hides from /admins - Chivava - 08.02.2010

Quote:
Originally Posted by Ettans
Add a check tho the /admins command.

pawn Код:
if(AdminDuty[i] == 0)
{
  // show the admins
}
Yes but i mean like what should it be ?

if(playerinfo[playerid][pAdminDuty] == 0
removefromadminlist // what should it be here ?


Re: Adminduty, hides from /admins - ettans - 08.02.2010

Nothing. You just add that check before showing the online admins.


Re: Adminduty, hides from /admins - Chivava - 08.02.2010

Quote:
Originally Posted by Ettans
Nothing. You just add that check before showing the online admins.
Problem is just that when you're not on duty atm you are still on the /admins

How can i make it like, it removes you from /admins..

This is how the lines look alike..

Код:
	if(!strcmp(cmdtext, "/adminduty", true)) 
	{
		if(IsPlayerConnected(playerid))
		{
		  if(gPlayerLogged[playerid] == 0)
		  {
		    SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
				return 1;
		  }
		  if(PlayerInfo[playerid][pAdmin] > 0)
		  {
		    if(AdminDuty[playerid] == 0)
		    {
		      AdminDuty[playerid] = 1;
		      SetPlayerArmour(playerid, 999);
					SetPlayerHealth(playerid, 999);
					SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes on duty as admin", playerid, sendername);
					ABroadCast(COLOR_YELLOW,string,1);
					if(PlayerInfo[playerid][pAdmin] >= 5)
					{
					  for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		    }
		    else if(AdminDuty[playerid] == 1)
		    {
		      AdminDuty[playerid] = 0;
		      SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,TEAM_HIT_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "[ADMIN] [ID:%d]%s goes off duty as admin", playerid, sendername);
					ABroadCast(COLOR_YELLOW,string,1);
					return 1;
		    }
		  }
		  else
		  {
		    SendClientMessage(playerid, COLOR_GREY, "  You're not the admin !");
		    return 1;
		  }
		}
	  return 1;
	}



Re: Adminduty, hides from /admins - Onyx09 - 08.02.2010

so what you are trying to do its that
player only appears on /admins if they are on duty?


Re: Adminduty, hides from /admins - ettans - 08.02.2010

Then add
pawn Код:
if(AdminDuty[i] == 1)
before listing the admins. That'll only show the admins if they are on duty.


Re: Adminduty, hides from /admins - Onyx09 - 08.02.2010

what you have to do its edit the code /admins and where it says this line

Код:
 if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341)
replace it for
if(AdminDuty[playerid] == 1)
this will fix it


Re: Adminduty, hides from /admins - Chivava - 08.02.2010

Quote:
Originally Posted by Reality King
what you have to do its edit the code /admins and where it says this line

Код:
 if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341)
replace it for
if(AdminDuty[playerid] == 1)
this will fix it
Sorry was too tirred to even think about looking into /admins, own fault but thanks for it anyways