Holds some helpful player functions.
| Player | Holds some helpful player functions. |
| Tables | |
| slapSounds | These are the sounds used for slaps. |
| Functions | |
| slap | Slaps an entity, can be a user or any entity. |
| kick | Kicks a user. |
| ban | Bans a user. |
| kickban | Kicks and bans a user. |
| addBan | Helper function to store additional data about bans. |
| unban | Unbans the given steamid. |
| invisible | Makes a user invisible |
| refreshBans | Refreshes the ULib bans. |
| getSpawnInfo | Grabs and returns player information that can be used to respawn player with same health/armor as before the spawn. |
| spawn | Enhanced spawn player. |
function ULib.slap( ent, damage, power, nosound )
Slaps an entity, can be a user or any entity.
| ent | The target ent. |
| damage | (Optional, defaults to 0) The amount of damage to inflict on the entity. |
| power | (Optional, defaults to 30) The power of the slap. |
| nosound | (Optional, defaults to false) If true, no sound will be played. |
function ULib.kickban( ply, time, reason, admin )
Kicks and bans a user.
| ply | The player to ban. |
| time | (Optional) The time in minutes to ban the person for, leave nil or 0 for permaban. |
| reason | (Optional) The reason for banning |
| admin | (Optional) Admin player enacting ban |
| v2.10 | Added support for custom ban list |
function ULib.addBan( steamid, time, reason, name, admin )
Helper function to store additional data about bans.
| steamid | Banned player’s steamid |
| time | Length of ban |
| reason | (Optional) Reason for banning |
| name | (Optional) Name of player banned |
| admin | (Optional) Admin player enacting the ban |
| 2.10 | Initial |
| 2.40 | If the steamid is connected, kicks them with the reason given |
function ULib.getSpawnInfo( player )
Grabs and returns player information that can be used to respawn player with same health/armor as before the spawn.
| ply | The player to grab information for. |
Updates player object to store health and armor. Has no effect unless ULib.Spawn is used later.
function ULib.spawn( player, bool )
Enhanced spawn player. Can spawn player and return health/armor to status before the spawn. (Only IF ULib.getSpawnInfo was used previously.) Clears previously set values that were stored from ULib.getSpawnInfo.
| ply | The player to grab information for. |
| bool | If true, spawn will set player information to values stored using ULib.SpawnInfo |
Spawns player. Sets health/armor to stored defaults if ULib.getSpawnInfo was used previously. Clears SpawnInfo table afterwards.
Slaps an entity, can be a user or any entity.
function ULib.slap( ent, damage, power, nosound )
Kicks a user.
function ULib.kick( ply, reason )
Bans a user.
function ULib.ban( ply, time, reason, admin )
Kicks and bans a user.
function ULib.kickban( ply, time, reason, admin )
Helper function to store additional data about bans.
function ULib.addBan( steamid, time, reason, name, admin )
Unbans the given steamid.
function ULib.unban( steamid )
Makes a user invisible
function ULib.invisible( ply, bool, visibility )
Refreshes the ULib bans.
function ULib.refreshBans()
Grabs and returns player information that can be used to respawn player with same health/armor as before the spawn.
function ULib.getSpawnInfo( player )
Enhanced spawn player.
function ULib.spawn( player, bool )