21.07.2014, 11:41
hey all hru guys my problem is with a cmd was made in the Melladmin admin system i wanted to change some small stuff but didnt know how as each person scripting has his own mind that no one can edit his work as i guess so here we go the cmd shows the online admins in chat wht i want it:
1)show it in a dialog using DIALOG_STYLE_LIST
2)i want if the admin is hidden he dont show up in the admins cmd my hidden var or wht is name is PlayerInfo[playerid][Hidden] thats wht i need any help/script edit/tut/tell me wht to do is appreciated ty all and here is the cmd:
1)show it in a dialog using DIALOG_STYLE_LIST
2)i want if the admin is hidden he dont show up in the admins cmd my hidden var or wht is name is PlayerInfo[playerid][Hidden] thats wht i need any help/script edit/tut/tell me wht to do is appreciated ty all and here is the cmd:
PHP код:
CMD:admins(playerid,params[])
{
#pragma unused params
SendClientMessage(playerid, PURPLE, "--------------------------------------");
new Count[2], i, string[128];
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(PlayerInfo[i][AdminLevel] > 0) Count[0]++;
if(IsPlayerAdmin(i)) Count[1]++;
}
if((Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][AdminLevel] == 0))
{
SendClientMessage(playerid, PURPLE, "{0800FF}[SERVER]: {FFFFFF}No Adminstrators Online");
SendClientMessage(playerid, PURPLE, "--------------------------------------");
return 1;
}
if(Count[0] == 1)
{
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0)
{
format(string, sizeof(string), "Admin: (%d)%s [AdminLevel: %d]", i, PlayerName(i), PlayerInfo[i][AdminLevel] ); SendClientMessage(playerid, BLUE, string);
}
}
if(Count[0] > 1)
{
new x; format(string, sizeof(string), "Admins:");
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0)
{
format(string,sizeof(string),"%s(%d)%s [AdminLevel: %d]",string,i,PlayerName(i),PlayerInfo[i][AdminLevel]);
x++;
if(x >= 5)
{
SendClientMessage(playerid, PURPLE, string); format(string, sizeof(string), "Admins: "); x = 0;
}
else format(string, sizeof(string), "%s, ", string);
}
if(x <= 4 && x > 0) {
string[strlen(string)-3] = '.';
SendClientMessage(playerid, PURPLE, string);
}
}
if( (Count[1] == 1) && (PlayerInfo[playerid][AdminLevel] > 0))
{
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
format(string, sizeof(string), "RCON Admin: (%d)%s", i, PlayerName(i));
SendClientMessage(playerid, GREEN, string);
}
}
if(Count[1] > 1)
{
new x; format(string, sizeof(string), "RCON Admins: ");
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
format(string,sizeof(string),"%s(%d)%s",string,i,PlayerName(i));
x++;
if(x >= 5)
{
SendClientMessage(playerid, WHITE, string); format(string, sizeof(string), "RCON Admins: "); x = 0;
}
else format(string, sizeof(string), "%s, ", string);
}
if(x <= 4 && x > 0)
{
string[strlen(string)-3] = '.';
SendClientMessage(playerid, GREEN, string);
}
}
SendClientMessage(playerid, PURPLE, "--------------------------------------");
return 1;
}