GetPlayersInEventOne()
{
new count;
for(new x=0; x< MAX_PLAYERS; x++)
{ //x = MAX_PLAYERS
if(Eventr[x]==1)
{
count++;
}
}
return count;
}
|
so what I need to do is that when it show me the dialogs it show me the ineventone players like a string how to do that? |
GetPlayersInEventOne()
{
new count[256],playname[MAX_PLAYER_NAME];
for(new x=0; x< MAX_PLAYERS; x++)
{ //x = MAX_PLAYERS
if(Eventr[x]==1)
{
GetPlayerName(x,playname,sizeof playname);
strins(count,playname,0);
}
}
return count;
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
COMMAND:inevent(playerid, params[])
{
for(new x=0; x< MAX_PLAYERS; x++)
{
if(Eventr[x]==1)
{
new name[MAX_PLAYER_NAME],string[50];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s ", PlayerName(q));
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_LIST,"Player in Event",string,"Okay","Cancel");
}
}
return 1;
}
CMD:COMMANDNAME(playerid, paramas[])
{
new string[1024]
for(new x=0; x< MAX_PLAYERS; x++)
{ //x = MAX_PLAYERS
if(Eventr[x] == 1)
{
format(string, sizeof(string), "%s\n<%d>{66FF66}%s", string, x, GetPlayerName(x,playname,sizeof playname));
}
}
ShowPlayerDialog(playerid, JustShow, DIALOG_STYLE_LIST, "TITLE", string, "OK", "OK");
return 1;
}