18.03.2012, 11:29
I don't really get it because it always gives me errors, can someone make it for me??
COMMAND:admins(playerid, params[])
{
new count = 1, name[24], string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s%s\n", string, name);
count ++;
}
}
if(count != 1)
{
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "Online Admins", string, "OK", "");
}
else ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "[!] Online Admins", "No online admins", "OK", "");
}
CMD:admins(playerid, params[])
{
new name[MAX_PLAYER_NAME], string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i);
{
if(IsPlayerAdmin(i);
{
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string),"%s", name);
SendClientMessage(playerid, -1, string);
}
}
}
return 1;
}
dcmd_admins(playerid, params[])
{
#pragma unused params
new pname[MAX_PLAYER_NAME];
new string[128];
new admins = 0;
new admtext[64];
SendClientMessage(playerid,COLOR_BLUE,"-----------------------Administrators Online-------------------------");
for(new i = 0; i < MAX_PLAYERS; i++){
if (IsPlayerConnected(i)){
if(AdminLevel[playerid] >= 1) { admtext = "Moderator"; }
if(AdminLevel[playerid] >= 2) { admtext = "Global Moderator"; }
if(AdminLevel[playerid] >= 3) { admtext = "Administrator"; }
if(AdminLevel[playerid] >= 4) { admtext = "Operative Administrator"; }
if(AdminLevel[playerid] >= 5) { admtext = "Head Administrator"; }
if(AdminLevel[playerid] >= 6) { admtext = "Junior Administrator"; }
if(AdminLevel[playerid] >= 1336) { admtext = "Tester/Developer"; }
if(AdminLevel[playerid] >= 1337) { admtext = "Trusted Admin"; }
if(AdminLevel[playerid] >= 1338) { admtext = "Server Owner"; }
GetPlayerName(i, pname, 24);
format(string,sizeof string,"%s - %s", pname,admtext);
SendClientMessage(playerid,-1,string);
admins++;
}
}
if(admins == 0){
SendClientMessage(playerid, COLOR_WHITE, "Currently there are no admins online.");
}
return 1;//This Command is for SAN FIERRO COPS AND ROBBERS
}