Help me with making /admins cmd -
RyanPetersons - 14.08.2012
Hello, guys.
Can you guys help me with making /admins cmd?
actually, i need /admins cmd, and i hope thats a bit difficult, but i want you guys to help me with it.
can you guys make me /admins cmd?
The variable is only PlayerInfo[playerid][pAdminLevel] and AdminLevel should be 4.
Re: Help me with making /admins cmd -
Kindred - 14.08.2012
Wait, you mean you want it so only level 4 admins can do /admins or make it so that only level 4 admins and above can be listed?
If you want, take a look at the /admins command I made for my own server for a tip as to how to make it (ZCMD)
pawn Код:
CMD:admins(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new admincount, string[128];
SendClientMessage(playerid, COLOR_GREEN, "Admin Team (online):");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 1)
{
admincount ++;
format(string, sizeof(string), "%s %s (ID:%i)", CheckPlayerAdmin(i), GetName(i), i);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if(admincount == 0) SendClientMessage(playerid, COLOR_WHITE, "No admins are currently online!");
}
return 1;
}
Re: Help me with making /admins cmd -
RyanPetersons - 14.08.2012
pawn Код:
CMD:admins(playerid,params[])
{
new online;
new adminname[240];
if(online == 0)
{
format(string,sizeof(string),"There are currently no admins online atm");
SendClientMessage(playerid,COLOR_YELLOW,string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdminLevel] < 4)
{
online ++;
GetPlayerName(PlayerInfo[playerid][pAdminLevel] == 4,adminname,sizeof(adminname));
format(string,sizeof(string),"%s {FFFFFF} Admin Level: Head Admin",adminname);
SendClientMessage(playerid,COLOR_YELLOW,string);
return 1;
}
if(PlayerInfo[i][pAdminLevel] < 3)
{
online ++;
GetPlayerName(PlayerInfo[playerid][pAdminLevel] == 3,adminname,sizeof(adminname));
format(string,sizeof(string),"%s {FFFFFF} Admin Level: Adminstrator",adminname);
SendClientMessage(playerid,COLOR_YELLOW,string);
return 1;
}
if(PlayerInfo[i][pAdminLevel] < 2)
{
online ++;
GetPlayerName(PlayerInfo[playerid][pAdminLevel] == 2,adminname,sizeof(adminname));
format(string,sizeof(string),"%s {FFFFFF} Admin Level: Global Moderator",adminname);
SendClientMessage(playerid,COLOR_YELLOW,string);
return 1;
}
if(PlayerInfo[i][pAdminLevel] < 1)
{
online ++;
GetPlayerName(PlayerInfo[playerid][pAdminLevel] == 1,adminname,sizeof(adminname));
format(string,sizeof(string),"%s {FFFFFF} Admin Level: Moderator",adminname);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
}
return 1;
}
Then, is this command correct i made myself?
Re: Help me with making /admins cmd -
RyanPetersons - 14.08.2012
Can anyone help me with this or reply here?