Player

Has useful player-related functions.

Summary
PlayerHas useful player-related functions.
Functions
getPickerGets the player directly in front of the specified player
getUsersFinds users matching an identifier.
getUserFinds a user matching an identifier.

Functions

getPicker

function ULib.getPicker(ply,
radius)

Gets the player directly in front of the specified player

Parameters

plyThe player to look for another player in front of.
radius(Optional, defaults to 30) How narrow to make our checks for players in front of us.

Returns

The player most directly in front of us if one exists with the given constraints, otherwise nil.

Revisions

v2.40Initial.

getUsers

function ULib.getUsers(target,
enable_keywords,
ply)

Finds users matching an identifier.

Parameters

targetA string of what you’d like to target.  Accepts a comma separated list.
enable_keywords(Optional, defaults to false) If true, the keywords “*” for all players, “^” for self, “@” for picker (person in front of you), and “%<group>” for targetting groups will be activated.  Any of these can be negated with “!” before it.  IE, “!^” targets everyone but yourself.
ply(Optional) Player needing getUsers, this is necessary for some of the keywords.

Returns

A table of players (false and message if none found).

Revisions

v2.40Rewrite, added more keywords, removed immunity.

getUser

function ULib.getUser(target,
enable_keywords,
ply)

Finds a user matching an identifier.

Parameters

targetA string of the user you’d like to target.  IE, a partial player name.
enable_keywords(Optional, defaults to false) If true, the keywords “^” for self and “@” for picker (person in front of you) will be activated.
ply(Optional) Player needing getUsers, this is necessary to use keywords.

Returns

The resulting player target, false and message if no user found.

Revisions

v2.40Rewrite, added keywords, removed immunity.
function ULib.getPicker(ply,
radius)
Gets the player directly in front of the specified player
function ULib.getUsers(target,
enable_keywords,
ply)
Finds users matching an identifier.
function ULib.getUser(target,
enable_keywords,
ply)
Finds a user matching an identifier.
Close