aduty command help
#1

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;
}
Reply
#2

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)
Reply
#3

thank you!

damn i can't give you rep ._.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)