Skip to content
This repository was archived by the owner on Apr 17, 2021. It is now read-only.

API Class: Tools.FindPlayerByPart()

D1G1T4L3CH0 edited this page Feb 12, 2015 · 1 revision

Summary

Returns a list of players with the matching text at the start of their name. Useful for auto-completing partial names.

Arguments

List FindPlayerByPart(string partName, bool ignoreCase = true)

Example(s)

  • 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
Clone this wiki locally