[Ajuda] Obter o ID pelo Nick
#2

Код:
ReturnUser(PlayerName[])
{
	if(IsNumeric(PlayerName))
	    return strval(PlayerName);
	else
	{
		new found=0, id;
		foreach(new i : Player)
		{
			new foundname[MAX_PLAYER_NAME];
			GetPlayerName(i, foundname, MAX_PLAYER_NAME);
			new namelen = strlen(foundname);
			new bool:searched=false;
			for(new pos=0; pos <= namelen; pos++)
			{
				if(searched != true)
				{
					if(strfind(foundname,PlayerName,true) == pos)
					{
						found++;
						id = i;
					}
				}
			}
		}
		if(found == 1)
			return id;
		else
			return INVALID_PLAYER_ID;
	}
}
Reply


Messages In This Thread
Obter o ID pelo Nick - by SIZET - 01.09.2018, 00:29
Re: Obter o ID pelo Nick - by Paulthaz - 01.09.2018, 00:32
Re: Obter o ID pelo Nick - by SIZET - 01.09.2018, 00:35
Re: Obter o ID pelo Nick - by Paulthaz - 01.09.2018, 00:59
Re: Obter o ID pelo Nick - by SIZET - 01.09.2018, 01:06
Re: Obter o ID pelo Nick - by InsaneBR - 01.09.2018, 01:51
Re: Obter o ID pelo Nick - by DelK - 01.09.2018, 13:27
Re: Obter o ID pelo Nick - by Paulthaz - 01.09.2018, 13:35
Re: Obter o ID pelo Nick - by Locky_ - 01.09.2018, 14:10
Re: Obter o ID pelo Nick - by SIZET - 01.09.2018, 14:26

Forum Jump:


Users browsing this thread: 1 Guest(s)