CMD:admins(playerid,params[])
{
new Count = 0;
new string[100], n[MAX_PLAYER_NAME];
SendClientMessage(playerid, 0x00FF00FF, "__________|Admins|__________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Level] > 0)
{
GetPlayerName(i,n,sizeof(n));
format(string,sizeof(string),"Level %d: %s (ID: %d) - %s", PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
SendClientMessage(playerid, 0xFF0000FF, string);
Count++;
}
}
if(Count == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "There Are No Administrators Online.");
}
SendClientMessage(playerid, 0x00FF00FF, "____________________________");
return 1;
}
CMD:admins(playerid,params[])
{
new Count = 0;
new string[100], n[MAX_PLAYER_NAME];
SendClientMessage(playerid, 0x00FF00FF, "__________|Admins|__________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Level] > 0)
{
GetPlayerName(i,n,sizeof(n));
format(string,sizeof(string),"Level %d: %s (ID: %d) - %s", PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
ShowPlayerDialog(playerid, 2,DIALOG_STYLE_MSGBOX, "online admins..", string, "ok", "");
Count++;
}
}
if(Count == 0)
{
ShowPlayerDialog(playerid, 2,DIALOG_STYLE_MSGBOX, "online admins..", "No admins online", "ok", "");
}
return 1;
}
if(PlayerInfo[i][Level] > 0)
{
GetPlayerName(i,n,sizeof(n));
format(string,sizeof(string),"%s%sLevel %d: %s (ID: %d) - %s", string, (( Count > 0 ) ? (", ") : ("")) PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
Count++;
}
}
ShowPlayerDialog(playerid, 2,DIALOG_STYLE_MSGBOX, "online admins..", string, "ok", "");
(( Count > 0 ) ? (", ") : (""))
|
online admins.. Level <level>: CBCandyBoy (ID: <id>) - <rank>, Level <level>: LarzI (ID: <id>) - <rank> |
format(string,sizeof(string),"%sLevel %d: %s (ID: %d) - %s\n", string, PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
|
online admins.. Level <level>: CBCandyBoy (ID: <id>) - <rank> Level <level>: LarzI (ID: <id>) - <rank> |
CMD:admins(playerid,params[])
{
new Count = 0;
new n[MAX_PLAYER_NAME];
new string[1000];
SendClientMessage(playerid, 0x00FF00FF, "__________|Admins|__________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][Level] < 1) continue;
GetPlayerName(i,n,sizeof(n));
format(string,sizeof(string),"%sLevel %d: %s (ID: %d) - %s\n", string, PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
Count++;
}
if(Count == 0)
{
ShowPlayerDialog(playerid, 2,DIALOG_STYLE_MSGBOX, "online admins..", "No admins online", "ok", "");
return 1;
}
ShowPlayerDialog(playerid, 2,DIALOG_STYLE_MSGBOX, "online admins..", string, "ok", "");
return 1;
}
|
Originally Posted by BenzoAMG
Another alternative is strcat
|