Even more library stuff that executes on both server and client.
Shared library | Even more library stuff that executes on both server and client. |
Variables | |
playerTable | Stores player names indexed by uid. |
Functions | |
nameFromID | Gets the last known player name for a user uid. |
nameToID | DO NOT CALL DIRECTLY, UPS HANDLES THIS FUNCTION Sets the name for use with nameFromID. |
ENTITY: UPSGetOwner | Gets the unique id of the owner of this prop. |
ENTITY: UPSGetOwnerEnt | Gets the player entity of the owner of this prop or nil if it has no owner or the owner is disconnected. |
ENTITY: UPSSetOwnerEnt | Sets the current entity owner to the player specified. |
ENTITY: UPSClearOwner | Clears the owner of this entity and puts it “up for grabs”. |
GAMEMODE: UPSAssignOwnership | This hook allows you to override an ownership change or simply catalog it. |
deleteAll | This function removes all of a player’s worldly possessions. |
function nameFromID( uid )
Gets the last known player name for a user uid. The unique id is based off GMod’s ply:UniqueID(). This is similar to GMod’s player.GetByUniqueID() except it keeps the names even after dicsconnect.
uid | A number or string representing the user’s uid. This value gets automatically converted to a number. |
The string of the player’s last known name if found, otherwise nil.
function nameToID( uid, name )
DO NOT CALL DIRECTLY, UPS HANDLES THIS FUNCTION Sets the name for use with nameFromID.
uid | A number or string representing the user’s uid. This value gets automatically converted to a number. |
name | The name to assign to the id. |
function deleteAll( uid, isLeaving )
This function removes all of a player’s worldly possessions. Handle with care! Note that this function is shared but it automatically invokes the client side part when called from the server.
uid | The uid of the owner who is about to lose everything they own. |
isLeaving | A boolean stating whether or not the player is disconnecting. If true, this function clears their data out completely. |
Stores player names indexed by uid.
playerTable
Gets the last known player name for a user uid.
function nameFromID( uid )
DO NOT CALL DIRECTLY, UPS HANDLES THIS FUNCTION Sets the name for use with nameFromID.
function nameToID( uid, name )
This hook allows you to override an ownership change or simply catalog it.
function GAMEMODE:UPSAssignOwnership( ply, ent )
This function removes all of a player’s worldly possessions.
function deleteAll( uid, isLeaving )