31.03.2013, 19:46
Hi, I'm having an issue with a command. Basicly what I'm trying to do is make a command which shows me names of all players in an event. It works fine with SendClientMessage, but fills my chat with names, and I don't want that. So I decided to put those names on a Dialog, but it just shows one name.
Here is my code:
Any help would be appreciated.
Thanks in advance.
Here is my code:
pawn Код:
if(strcmp(cmdtext,"/seeplayers",true) == 0)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(InEvent[i] == 1))
{
new name[MAX_PLAYER_NAME], string[50+MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), " - %s", name);
ShowPlayerDialog(playerid,MY_DIALOG_ID, DIALOG_STYLE_MSGBOX, "Players in Event", string, "Ok", "");//My Dialog
}
}
}
return 1;
}
Thanks in advance.