List of players with a special criteria
#1

So, i need a dialog that will show the list of people with a special criteria
Example:
Код:
stock criteria();
{
	for(new i; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(GetPlayerWantedLevel(playerid) > 1)
			{
				//code that adds the player to the dialog
			}
		}
	}
	new list[5000];
	format(list, sizeof(list), ?);
	ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "Playerlist", list, "ok","ok");
}
How could i manage to make the list show each player with more than 1 wanted level in a new line? (There shouldn't be empty lines)
Reply
#2

What database type are you using? Is it sql based or flatfile?
Reply
#3

Quote:
Originally Posted by Livar
Посмотреть сообщение
What database type are you using? Is it sql based or flatfile?
It's sql
Reply
#4

Код:
stock criteria();
{
	new szList[800];
	for(new i; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(GetPlayerWantedLevel(i) > 1)
			{
				format(szList, sizeof(szList), "%s-%s (Wanted Level: %d\n", szList, Getlayername(i), GetPlayerWantedLevel(i)); // Change the getplayername the i = Playerid you're looping all players in the server
			}
		}
	}
	ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "Playerlist", list, "ok","ok");
}
Reply
#5

Quote:
Originally Posted by ToiletDuck
Посмотреть сообщение
Код:
stock criteria();
{
	new szList[800];
	for(new i; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(GetPlayerWantedLevel(i) > 1)
			{
				format(szList, sizeof(szList), "%s-%s (Wanted Level: %d\n", szList, Getlayername(i), GetPlayerWantedLevel(i)); // Change the getplayername the i = Playerid you're looping all players in the server
			}
		}
	}
	ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "Playerlist", list, "ok","ok");
}
Much Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)