Posts: 89
Threads: 10
Joined: Feb 2012
Reputation:
0
How can i get all player names who are online and use it in dialog?
Im planing to make wiretransfer system like:
First u get dialog list where u can choose "Wiretransfer" then u get all ppls names in dialog list who are online, and then u get dialog input where u can put amount u want to transfer.
Is it possible at all?
Posts: 89
Threads: 10
Joined: Feb 2012
Reputation:
0
Im gonna test it tomorrow, tnx for reply.
suhrab_mujeeb
Unregistered
Quote:
Originally Posted by Nuke547
This should work. And I know there is a more efficient way to do it with the string, but for now, you can do it by how many people you have on your server.
PHP код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
new name[MAX_PLAYER_NAME], string[126];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s\n%s",name);
showplayerdialog(playerid, DIALOG_STYLE_LIST, casenumber, "Users", string, "Select", "Cancel");
}
|
Not gonna work as far as I know.
Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
new name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME * YOUR_SERVER_SLOTS]; // YOUR_SERVER_SLOTS more than 50 is very big
for(new i,g = GetMaxPlayers(); i < g; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s%s\n",string,name);
}
}
ShowPlayerDialog(playerid, dialog_ID, DIALOG_STYLE_LIST, "Users OnLine", string, "Select", "Cancel");