General > Developers Corner

Finding a player by chat.

(1/1)

Conor:
Hello  ;D
I've been coding lua for about 2 months now,
I am trying to figure out how to find a players entire name by just typing have of it and searching for results.
Let's say I wanted to change a persons color to red when an admin types

--- Code: ---!Red <PARTIAL SEGMENT OF PLAYERS NAME>"
--- End code ---
.
How would I do this?

edit:

--- Code: ---hook.Add( "PlayerSay", "HookNameBlarg", FunctionBlarg )

--- End code ---

MrPresident:
if you are using ULib, then it is really easy.

If you are trying to return a player object so that you can use it in your code you can do the following.

ULib.getUser(partialname)

this will return the user with that partial name or an error if there are more than 1 results.

JamminR:
http://ulyssesmod.net/docs/files/lua/ulib/shared/player-lua.html#getUser

Navigation

[0] Message Index

Go to full version