SA-MP Forums Archive
aduty command help - 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)
+--- Thread: aduty command help (/showthread.php?tid=564101)



aduty command help - Nabster - 19.02.2015

the on duty text dont works

Код:
CMD:admins(playerid,params[])
{
	new string[128];
	new player[128];
	SendClientMessage(playerid,COLOR_MENUHIGHLIGHT, "|---Currently Online Admins---|");
	new count;
	for(new i = 0; i < MAX_PLAYERS; i++)
		{
		  if(IsPlayerConnected(i))
		    {
		      if(PInfo[i][Level] >= 1 && PInfo[i][Level] <= 7)
				{
				  GetPlayerName(i,player,sizeof(player));
				  format(string,256,"Administrators: %s(%d) - Level %d",player,i,PInfo[playerid][Level]);
				  SendClientMessage(playerid,COLOR_CYAN,string);
				  count++;
				}
			   else if(PInfo[i][Level] >= 1 && PInfo[i][Level] <= 7 && PInfo[i][pAdminDuty] == 1)
			    {
                  GetPlayerName(i,player,sizeof(player));
				  format(string,256,"Administrators: %s(%d) - Level %d [ON DUTY]",player,i,PInfo[playerid][Level]);
				  SendClientMessage(playerid,COLOR_CYAN,string);
				  count++;
		        }
			}
		}
	if(count == 0)
	{
 	SendClientMessage(playerid,COLOR_CYAN,"No admins are online.");
	}
 	SendClientMessage(playerid,COLOR_MENUHIGHLIGHT,"|---------------------------------------|");
	return 1;
}



Re: aduty command help - CalvinC - 19.02.2015

You should only activate the first if the admin isn't on duty, otherwise it'll activate nomatter what, and then the next wont.
Like this:
pawn Код:
if(PInfo[i][Level] >= 1 && PInfo[i][Level] <= 7 && PInfo[i][pAdminDuty] == 0)
else if(PInfo[i][Level] >= 1 && PInfo[i][Level] <= 7 && PInfo[i][pAdminDuty] == 1)



Re: aduty command help - Nabster - 19.02.2015

thank you!

damn i can't give you rep ._.