concommand taking player nick as argument?

Hey, i wanted to know how to make a concommand like “give ben weapon_357”, how do i get a player entity from the nick? I know the rest, Thanks.

As I said:

[lua]

function StringToPlayer(nick)

local found = {} // players fitting the name

for k,v in pairs(player.GetAll()) do

if string.find(string.lower(v:Nick()),string.lower(nick)) != nil then
table.insert(found,v)
end

end

if #found == 1 then
return found[1]
end

print("Too many or no players found with "…nick)
return nil

end

[/lua]