28.08.2010, 08:36
Hello,
I have made an /admins command, that will display all admins in the game on a list. Only my problem is that it don't work. The list displays only one admin.
Please help me if you know the answer.
Greetz,
Danny
I have made an /admins command, that will display all admins in the game on a list. Only my problem is that it don't work. The list displays only one admin.
Код:
dcmd_admins(playerid, cmdtext[]) {
#pragma unused cmdtext
SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "Admins online:");
new admins = 0;
new string[100];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][adminlevel] == 1)
{
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "%d) Name: %s, ID: %d", admins, pname, i,(i));
SendClientMessage(playerid, COLOR_GREY, string);
admins++;
return 1;
}
}
}
if(admins == 0)
{
SendClientMessage(playerid,0xFF0000AA, "There are currently no admins online");
return 1;
}
return 1;
}
Greetz,
Danny


