Helper function to store additional data about bans.
function ULib.addBan( steamid, time, reason, name, admin )
You must run this function on BOTH client AND server. This function is very similar to garry’s concommand.Add() function with a few key differences.
function cmds.addCommand( cmd, fn, autocomplete, access_string, say_cmd, hide_say, no_space_in_say )
Exactly like cmds.addCommand, except it will expect the callback to be run on the local client instead of the server.
function cmds.addCommandClient( cmd, fn, autocomplete )
Adds a new group to the UCL.
function ucl.addGroup( name, allows, inherit_from )
Just like ULib’s concommand() except that the callback is called when the command is said in chat instead of typed in the console.
function ULib.addSayCommand( say_cmd, fn_call, access, hide_say, nospace )
Adds a user to the UCL.
function ucl.addUser( id, allows, denies, group )
function ULib.applyAccel( ent, magnitude, direction, dTime )
Applies an acceleration in the entities current velocity direction ( not the entity’s heading ).
function ULib.applyAccelInCurDirection( ent, magnitude, dTime )
function ULib.applyForce( ent, magnitude, direction, dTime )
Applies a force in the entities current velocity direction ( not the entity’s heading ).
function ULib.applyForceInCurDirection( ent, magnitude, dTime )
Copies a file to a backup file.
function ULib.backupFile( f )
Bans a user.
function ULib.ban( ply, time, reason, admin )
Used to autocomplete a command.
function cmds.BaseArg:complete( arg, cmdInfo, plyRestrictions )
Used to, you guessed it, parse and validate an argument specified by a user.
function cmds.BaseArg:parseAndValidate( ply, arg, cmdInfo, plyRestrictions )
Prints a basic usage message for this parameter.
function cmds.BaseArg:usage( cmdInfo, plyRestrictions )
See cmds.BaseArg:complete
function cmds.BoolArg:complete( ply, arg, cmdInfo, plyRestrictions )
See cmds.BaseArg:parseAndValidate
function cmds.BoolArg:parseAndValidate( ply, arg, cmdInfo, plyRestrictions )
A helper function to help us figure out restrictions on this command.
function cmds.BoolArg:processRestrictions( cmdRestrictions, plyRestrictions )
See cmds.BaseArg:usage
function cmds.BoolArg:usage( cmdInfo, plyRestrictions )
See cmds.BaseArg:parseAndValidate
function cmds.CallingPlayerArg:parseAndValidate( ply, arg, cmdInfo, plyRestrictions )
Checks to see if an arg matches what is expected, if not, calls throwBadArg().
function ULib.checkArg( argnum, fnName, expected, data, throwLevel )
Think of this function as if you’re calling a client function directly from the server.
function ULib.clientRPC( plys, fn, ... )
Prints a message in the user’s consoles.
function ULib.console( ply, msg )
Prints a message in center of the screen as well as in the user’s consoles.
function ULib.csay( ply, msg, color, duration, fade )
Draws a csay text on the screen.
function ULib.csayDraw( msg, color, duration, fade )
Prints a function call, very useful for debugging.
function ULib.debugFunctionCall( name, ... )
Gives an error to console.
function ULib.error( s )
Executes a file on the console.
function ULib.execFile( f, usebasefolder )
Just like execFile, except acts on newline-delimited strings.
function ULib.execString( f, ply )
Split a string by a separator.
function ULib.explode( separator, str, limit )
Returns files in directory.
function ULib.filesInDir( dir, recurse, root )
Finds a value in a table.
function ULib.findInTable( t, check, init, last, recursive )
Given a string, find a var starting from the global namespace.
function ULib.findVar( var )
Similar to player.GetAll(), except it only returns players that have ULib ready to go.
function ULib.getAllReadyPlayers()
Gets what a group is allowed to target in the UCL.
function ucl.getGroupCanTarget( group )
This function returns a tree-like structure representing the group inheritance architecture.
function ucl.getInheritanceTree()
Gets the player directly in front of the specified player
function ULib.getPicker( ply, radius )
function ULib.getPlyByUID( uid )
Grabs and returns player information that can be used to respawn player with same health/armor as before the spawn.
function ULib.getSpawnInfo( player )
Finds a user matching an identifier.
function ULib.getUser( target, enable_keywords, ply )
Returns the SteamID, IP, or UniqueID of a player if they’re registered under any of those IDs under ucl.users.
function ucl.getUserRegisteredID( ply )
Finds users matching an identifier.
function ULib.getUsers( target, enable_keywords, ply )
Adds or removes an access tag in the allows for a group.
function ucl.groupAllow( name, access, revoke )
This function is used to see if a specified group is inheriting from another
function ucl.groupInheritsFrom( group )
Creates a psudeo-inheritance for lua.
function inheritsFrom( base_class )
Makes a user invisible
function ULib.invisible( ply, bool, visibility )
The normal GM10 bind is broken, this fixes it.
function isDedicatedServer() -- The normal GM10 function isn't working, let's define a hack
Returns true if the current gamemode is sandbox or is derived from sandbox.
function ULib.isSandbox()
Checks to see if a given string is a valid IPv4 address.
function ULib.isValidIP( ip )
Checks to see if a given string is a valid steamid.
function ULib.isValidSteamID( steamid )
Kicks a user.
function ULib.kick( ply, reason )
Kicks and bans a user.
function ULib.kickban( ply, time, reason, admin )
Makes a key values string from a table.
function ULib.makeKeyValues( t, tab, completed )
Makes a string safe for pattern usage, like in string.gsub().
function ULib.makePatternSafe( str )
Makes a table and all recursive tables read-only
function ULib.makeReadOnly( t )
Splits a table into a number of given columns.
function ULib.matrixTable( t, columns )