This repository was archived by the owner on Apr 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
API Class: Tools.FindPlayerByPart()
D1G1T4L3CH0 edited this page Feb 12, 2015
·
1 revision
Returns a list of players with the matching text at the start of their name. Useful for auto-completing partial names.
List FindPlayerByPart(string partName, bool ignoreCase = true)
-
Lua
Locates a player by name. As an example, this is using the SignTextSet hook. When a player inputs a name either partial or complete ignoring case, a full player name will be returned if a player's name is found matching the text on the sign.
function YourPlugin:OnSignTextSet(ctx, args)
Players = Tools.FindPlayerByPart(args.Text)
Tools.WriteLine(Players[0].name)
end