Return a player when the name is found.

I saw it a few days ago and now forgot how.

Does anyone know how if i sent a function RTM xBEASTx how i can make it return the player as a entity.

What?

Something like this?
[lua]
function FindPlayer(info)
local pls = player.GetAll()

	for k, v in pairs(pls) do
		if string.find(string.lower(v:Name()), string.lower(tostring(info)), 1, true) ~= nil then
			return v
		end
	end
	return nil
end

[/lua]

Ill try it now. Thanks anyway.

[editline]7th March 2011[/editline]

Thank you. It worked perfect.

Oh, sorry for not understanding you.

It’s ok, I typed in a hurry to get the code finished.

I’m not very good at putting stuff across.

Please may I add you on steam, you seem good with Lua and I need quite a bit of help.

You can add me RTM I am happy to help