admins CMD -
Biess - 23.09.2012
pawn Код:
CMD:admins(playerid,params[]) // Admins command
{
SendClientMessage(playerid,blue,"[----Current on duty Administrators----]");
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(IsOnAdminDuty[i] == true)
{
new aname[24],astring[124];
GetPlayerName(playerid,aname,sizeof(aname));
format(astring,sizeof(astring),"%s ",aname);
SendClientMessage(playerid,blue,astring);
}
}
return 1;
}
I want there if it sees the name "Max" he will appear as "Owner Max"
Re: admins CMD -
clarencecuzz - 23.09.2012
pawn Код:
CMD:admins(playerid,params[]) // Admins command
{
SendClientMessage(playerid,blue,"[----Current on duty Administrators----]");
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(IsOnAdminDuty[i] == true)
{
new aname[24],astring[124];
GetPlayerName(i,aname,sizeof(aname));
if(strcmp(aname, "Max", false) == 0)
{
format(astring,sizeof(astring),"Owner %s",aname);
}
else
{
format(astring,sizeof(astring),"%s",aname);
}
SendClientMessage(playerid,blue,astring);
}
}
return 1;
}
Re: admins CMD -
Lordzy - 23.09.2012
Try this
pawn Код:
#define MAXLevel 10 //Now the max level is 10 for owner.
CMD:admins(playerid,params[]) // Admins command
{
SendClientMessage(playerid,blue,"[----Current on duty Administrators----]");
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(IsOnAdminDuty[i] == true)
{
new aname[24],astring[124];
GetPlayerName(playerid,aname,sizeof(aname));
format(astring,sizeof(astring),"%s ",aname);
SendClientMessage(playerid,blue,astring);
}
if(IsOnAdminDuty[i] == true && AccInfo[i][Level]>=MAXLevel)
{
new aname[24],astring[124];
GetPlayerName(playerid,aname,sizeof(aname));
format(astring,sizeof(astring),"%s (Owner) ",aname);
SendClientMessage(playerid,blue,astring);
}
}
return 1;
}
I've used another admin variable "
AccInfo[playerid][Level]", so please replace it and use.
Also here, maxlevel is 10.
You can change it to your maxlevel.
Edit: Oops, I thought you need /admin command which shows owner rank according to levels.
Sorry now Im seeing that if "MAX" is logged in, then in admin list he should have owner rank.
Re: admins CMD -
Biess - 23.09.2012
Quote:
Originally Posted by clarencecuzz
pawn Код:
CMD:admins(playerid,params[]) // Admins command { SendClientMessage(playerid,blue,"[----Current on duty Administrators----]"); for(new i = 0; i <MAX_PLAYERS; i++) { if(IsOnAdminDuty[i] == true) { new aname[24],astring[124]; GetPlayerName(i,aname,sizeof(aname)); if(strcmp(aname, "Max", false) == 0) { format(astring,sizeof(astring),"Owner %s",aname); } else { format(astring,sizeof(astring),"%s",aname); } SendClientMessage(playerid,blue,astring); } } return 1; }
|
Awesome that worked, can you now also add the level behind the name ((FOR EVERYONE))
Maximum admin level is level 7
pawn Код:
if(PInfo[playerid][Level] < ADMINLEVEL)
Re: admins CMD -
clarencecuzz - 23.09.2012
pawn Код:
CMD:admins(playerid,params[]) // Admins command
{
SendClientMessage(playerid,blue,"[----Current on duty Administrators----]");
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(IsOnAdminDuty[i] == true)
{
if(PInfo[i][Level] > 0)
{
new aname[24],astring[124];
GetPlayerName(i,aname,sizeof(aname));
if(strcmp(aname, "Max", false) == 0)
{
format(astring,sizeof(astring),"(Level: %d) Owner %s",PInfo[i][Level],aname);
}
else
{
format(astring,sizeof(astring),"(Level: %d) %s",PInfo[i][Level],aname);
}
SendClientMessage(playerid,blue,astring);
}
else continue;
}
else continue;
}
return 1;
}
Re: admins CMD -
Biess - 23.09.2012
Quote:
Originally Posted by clarencecuzz
pawn Код:
CMD:admins(playerid,params[]) // Admins command { SendClientMessage(playerid,blue,"[----Current on duty Administrators----]"); for(new i = 0; i <MAX_PLAYERS; i++) { if(IsOnAdminDuty[i] == true) { if(PInfo[i][Level] > 0) { new aname[24],astring[124]; GetPlayerName(i,aname,sizeof(aname)); if(strcmp(aname, "Max", false) == 0) { format(astring,sizeof(astring),"(Level: %d) Owner %s",PInfo[i][Level],aname); } else { format(astring,sizeof(astring),"(Level: %d) %s",PInfo[i][Level],aname); } SendClientMessage(playerid,blue,astring); } else continue; } else continue; } return 1; }
|
Does it count Under eichother?
Re: admins CMD -
clarencecuzz - 23.09.2012
Does what count under each other? If you need it to say 'There are no Administrators on duty.', then I can add that too.
Re: admins CMD -
Biess - 23.09.2012
Quote:
Originally Posted by clarencecuzz
Does what count under each other? If you need it to say 'There are no Administrators on duty.', then I can add that too.
|
Sure add it, but i mean does the Admins count under eichtother like
(Level:2) Cooldude
(Level:2) Awesome dude
or like this (Level:2) Cooldude (Level:2) Awesome dude
I want it like the first one.
Re: admins CMD -
clarencecuzz - 23.09.2012
pawn Код:
CMD:admins(playerid,params[]) // Admins command
{
SendClientMessage(playerid,blue,"[----Current on duty Administrators----]");
new Count = 0;
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(IsOnAdminDuty[i] == true)
{
if(PInfo[i][Level] > 0)
{
new aname[24],astring[124];
GetPlayerName(i,aname,sizeof(aname));
if(strcmp(aname, "Max", false) == 0)
{
format(astring,sizeof(astring),"Owner %s (Level: %d)",aname,PInfo[i][Level]);
}
else
{
format(astring,sizeof(astring),"%s (Level: %d)",aname,PInfo[i][Level]);
}
SendClientMessage(playerid,blue,astring);
Count++;
}
else continue;
}
else continue;
}
if(Count == 0)
{
SendClientMessage(playerid, blue, "There Are Currently No Administrators On Duty.");
}
return 1;
}
And yes, they will count underneath each other.
Re: admins CMD -
Biess - 23.09.2012
Quote:
Originally Posted by clarencecuzz
pawn Код:
CMD:admins(playerid,params[]) // Admins command { SendClientMessage(playerid,blue,"[----Current on duty Administrators----]"); new Count = 0; for(new i = 0; i <MAX_PLAYERS; i++) { if(IsOnAdminDuty[i] == true) { if(PInfo[i][Level] > 0) { new aname[24],astring[124]; GetPlayerName(i,aname,sizeof(aname)); if(strcmp(aname, "Max", false) == 0) { format(astring,sizeof(astring),"Owner %s (Level: %d)",aname,PInfo[i][Level]); } else { format(astring,sizeof(astring),"%s (Level: %d)",aname,PInfo[i][Level]); } SendClientMessage(playerid,blue,astring); Count++; } else continue; } else continue; } if(Count == 0) { SendClientMessage(playerid, blue, "There Are Currently No Administrators On Duty."); } return 1; }
And yes, they will count underneath each other.
|
Thanks! i would rep you but i can't since i've already repped you yesterday