SA-MP Forums Archive
Find player id (from name) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Find player id (from name) (/showthread.php?tid=662849)



Find player id (from name) - GospodinX - 13.01.2019

Hi guys,

I need help how to make command which will give you list of players with that name.For example if I have on server
ID 0: John_Smith
ID 1: John_Williams
ID 2: John_Taylor

When I type /find John he need to give me list of that names.

For example if I do this:

Код:
YCMD:find(playerid, params[],help)
{
	new string[75], target;
	if(sscanf(params, "u", target))
	{
		return 1;
	}
	if(IsPlayerConnected(target))
	{
		if(target != INVALID_PLAYER_ID)
		{
			format(string, sizeof(string), "(%d) %s",target,GetName(target));
			SendClientMessage(playerid, -1, string);
		}
	}
	return 1;
}
He will give me just first ID(John_Smith) ..I need all names which have John.


Re: Find player id (from name) - Calisthenics - 13.01.2019

https://sampforum.blast.hk/showthread.php?tid=602923

Read Users section (bottom of first post)


Re: Find player id (from name) - GospodinX - 13.01.2019

I'm find it,thank you very much.