There is probably a faster and easier way but this works.
PHP код:
#define DIALOG_WANTEDPLAYERS 1
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/wantedplayers", true))
{
new TotalWantedPlayers = 0;
new PlayerCheck = 0;
new StringSlot = 1;
new NameSlot1[64];
new NameSlot2[64];
new NameSlot3[64];
new NameSlot4[64];
new NameSlot5[64];
new NameSlot6[64];
new NameSlot7[64];
new NameSlot8[64];
new NameSlot9[64];
new NameSlot10[64];
new NameSlot11[64];
new NameSlot12[64];
new NameSlot13[64];
new NameSlot14[64];
new NameSlot15[64];
new NameSlot16[64];
new NameSlot17[64];
new NameSlot18[64];
new NameSlot19[64];
new NameSlot20[64];
while(PlayerCheck<MAX_PLAYERS && StringSlot < 21)
{
if(GetPlayerWantedLevel(PlayerCheck) > 0)
{
if(StringSlot == 1)
{
GetPlayerName(playerid, NameSlot1, MAX_PLAYER_NAME+1);
}
if(StringSlot == 2)
{
GetPlayerName(playerid, NameSlot2, MAX_PLAYER_NAME+1);
}
if(StringSlot == 3)
{
GetPlayerName(playerid, NameSlot3, MAX_PLAYER_NAME+1);
}
if(StringSlot == 4)
{
GetPlayerName(playerid, NameSlot4, MAX_PLAYER_NAME+1);
}
if(StringSlot == 5)
{
GetPlayerName(playerid, NameSlot5, MAX_PLAYER_NAME+1);
}
if(StringSlot == 6)
{
GetPlayerName(playerid, NameSlot6, MAX_PLAYER_NAME+1);
}
if(StringSlot == 7)
{
GetPlayerName(playerid, NameSlot7, MAX_PLAYER_NAME+1);
}
if(StringSlot == 8)
{
GetPlayerName(playerid, NameSlot8, MAX_PLAYER_NAME+1);
}
if(StringSlot == 9)
{
GetPlayerName(playerid, NameSlot9, MAX_PLAYER_NAME+1);
}
if(StringSlot == 10)
{
GetPlayerName(playerid, NameSlot10, MAX_PLAYER_NAME+1);
}
if(StringSlot == 11)
{
GetPlayerName(playerid, NameSlot11, MAX_PLAYER_NAME+1);
}
if(StringSlot == 12)
{
GetPlayerName(playerid, NameSlot12, MAX_PLAYER_NAME+1);
}
if(StringSlot == 13)
{
GetPlayerName(playerid, NameSlot13, MAX_PLAYER_NAME+1);
}
if(StringSlot == 14)
{
GetPlayerName(playerid, NameSlot14, MAX_PLAYER_NAME+1);
}
if(StringSlot == 15)
{
GetPlayerName(playerid, NameSlot15, MAX_PLAYER_NAME+1);
}
if(StringSlot == 16)
{
GetPlayerName(playerid, NameSlot16, MAX_PLAYER_NAME+1);
}
if(StringSlot == 17)
{
GetPlayerName(playerid, NameSlot17, MAX_PLAYER_NAME+1);
}
if(StringSlot == 18)
{
GetPlayerName(playerid, NameSlot18, MAX_PLAYER_NAME+1);
}
if(StringSlot == 19)
{
GetPlayerName(playerid, NameSlot19, MAX_PLAYER_NAME+1);
}
if(StringSlot == 20)
{
GetPlayerName(playerid, NameSlot20, MAX_PLAYER_NAME+1);
}
StringSlot = StringSlot+1;
TotalWantedPlayers = TotalWantedPlayers+1;
}
PlayerCheck = PlayerCheck+1;
}
new string[256];
format(string,sizeof(string),"Total wanted players: %d", TotalWantedPlayers);
SendClientMessage(playerid,-1,string);
new TwentyNamesString[1280];
format(TwentyNamesString,sizeof TwentyNamesString,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",NameSlot1,NameSlot2,NameSlot3,NameSlot4,NameSlot5,NameSlot6,NameSlot7,NameSlot8,NameSlot9,NameSlot10,NameSlot11,NameSlot12,NameSlot13,NameSlot14,NameSlot15,NameSlot16,NameSlot17,NameSlot18,NameSlot19,NameSlot20);
ShowPlayerDialog(playerid, DIALOG_WANTEDPLAYERS, DIALOG_STYLE_MSGBOX, "Wanted Players", TwentyNamesString, "Close", "");
return 1;
}
return 0;
}