Passing player name from clientside from derma list as entity to server
2 replies, posted
It's a bit hard to explain, but essentially, I have an f3 menu on the client side. This menu creates two columns, 1 for player names and 1 for faction name
So the rows come from the ply:Nick()
I know how to get the selected row's text for each column.
How do I turn that text into the actual player entity then pass it off to a module function.
If any of the code is needed, I can post it, but it's very separated.
You have to loop through all the players to check if their nickname is that string, there isn't really an easy way.
[editline]5th July 2016[/editline]
E.G.
[CODE]
local function GetPlayerFromName( name )
for k,v in pairs(player.GetHumans()) do
if v:Nick() == name then return v end
end
end
[/CODE]
^ Untested
Just send the player itself. You are already looping through every player to display their name. You can use that same loop to associate the player object with the row.
Sorry, you need to Log In to post a reply to this thread.