Ulysses

General => Developers Corner => Topic started by: Conor on August 27, 2010, 11:28:08 AM

Title: Finding a player by chat.
Post by: Conor on August 27, 2010, 11:28:08 AM
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: [Select]
!Red <PARTIAL SEGMENT OF PLAYERS NAME>".
How would I do this?

edit:
Code: [Select]
hook.Add( "PlayerSay", "HookNameBlarg", FunctionBlarg )
Title: Re: Finding a player by chat.
Post by: MrPresident on August 27, 2010, 12:25:09 PM
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.
Title: Re: Finding a player by chat.
Post by: JamminR on August 27, 2010, 09:34:45 PM
http://ulyssesmod.net/docs/files/lua/ulib/shared/player-lua.html#getUser