19.02.2017, 01:15
Como fazer um dialog simples de mostrar todos os jogadores Online em um dialog?
tipo o TAB.
tipo o TAB.
CMD:players(playerid)
{
new aStr1[30], aStr2[300];
foreach(new i : Player)
{
format(aStr1, sizeof(aStr1),"%s\n", NomeJ(i));
strcat(aStr2, aStr1);
}
ShowPlayerDialog(playerid, DIALOG_PLAYERS, DIALOG_STYLE_LIST,"Jogadores", aStr2, "Oi","Tchau");
return 1;
}
didimk(playerid)
{
new didi[MAX_PLAYER_NAME];
GetPlayerName(playerid, didi, sizeof(Nj));
return didi;
}
#include a_samp
#include zcmd
CMD:plist(playerid)
{
new string[34], string2[356];
for(new i = 0; 0 < GetMaxPlayers(); i++)
{
format(string, sizeof(string),"%s\n", pName(i));
strcat(string2, string);
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Players", string2, "Selecionar", "");
return 1;
}
stock pName(playerid)
{
new name[24];
GetPlayerName(playerid, name, 24);
return name;
}
#include a_samp
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/plist", cmdtext, true, 10) == 0)
{
new string[34], string2[356];
for(new i = 0; 0 < GetMaxPlayers(); i++)
{
format(string, sizeof(string),"%s\n", pName(i));
strcat(string2, string);
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Players", string2, "Selecionar", "");
return 1;
}
return 0;
}
stock pName(playerid)
{
new name[24];
GetPlayerName(playerid, name, 24);
return name;
}