16.05.2015, 11:06
What's wrong? This codes work but show only the last admin online not all admins.
dcmd_test(playerid, params[])
{
#pragma unused params //format(string2, 556, "{0DF600}Admin Level: {00E1B8}%d\n", PlayerInfo[playerid][Admin]); strcat(string, string2);
if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
new sendername[MAX_PLAYER_NAME], string[1000], string2[556];
strcat(string, string2);
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, sendername, sizeof(sendername)); //FFBF00
if(PlayerInfo[i][Admin] >= 1) format(string2, 556, "{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d\n",sendername,i,PlayerInfo[i][Admin]);
//if(IsPlayerAdmin(i)) format(string2, 556, "{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d {FFBF00}(RCON)\n",sendername,i,IsPlayerAdmin(i));
{
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_LIST, "Admins Online",string2, string, "Close");
}
}
}
}
return 1;
}
dcmd_test(playerid, params[])
{
#pragma unused params //format(string2, 556, "{0DF600}Admin Level: {00E1B8}%d\n", PlayerInfo[playerid][Admin]); strcat(string, string2);
if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
new sendername[MAX_PLAYER_NAME], string[1000], string2[556];
strcat(string, string2);
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, sendername, sizeof(sendername)); //FFBF00
if(PlayerInfo[i][Admin] >= 1) format(string2, 556, "{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d\n",sendername,i,PlayerInfo[i][Admin]);
//if(IsPlayerAdmin(i)) format(string2, 556, "{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d {FFBF00}(RCON)\n",sendername,i,IsPlayerAdmin(i));
{
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_LIST, "Admins Online",string2, string, "Close");
}
}
}
}
return 1;
}