Library

Server-side library functions for UPS.

Summary
LibraryServer-side library functions for UPS.
Functions
playDenySoundTakes care of playing the “access denied” sound to a client.
PLAYER: UPSGetOwnedEntsGets a table of entities this player owns.
getUIDOwnedEntsGets a table of entities this uid owns.
replicatedWritableCvarThis function is mainly intended for use with the menus.

Functions

playDenySound

function playDenySound(ply)

Takes care of playing the “access denied” sound to a client.  IE, use this when they try to grab a prop they cannot.

Parameters

plyA valid player object to the play the sound to

PLAYER: UPSGetOwnedEnts

Gets a table of entities this player owns.  The table is indexed by entity and the value is always true.  The table is done this way so you don’t have to search the table for an entity.

Returns

The table.

getUIDOwnedEnts

function getUIDOwnedEnts(uid)

Gets a table of entities this uid owns.  The table is indexed by entity and the value is always true.  The table is done this way so you don’t have to search the table for an entity.

Returns

The table or nil if the uid isn’t known.

replicatedWritableCvar

function replicatedWritableCvar(sv_cvar,
cl_cvar,
default_value,
save,
notify,
access)

This function is mainly intended for use with the menus.  This function is very similar to creating a replicated cvar with one caveat.  This function also creates a cvar on the client that can be modified and will be sent back to the server.  The value of the client cvars are updated on spawn menu open and only sent back to the server if changed on spawn menu close.

Parameters

sv_cvarThe string of server side cvar.
cl_cvarThe string of the client side cvar.  THIS MUST BE DIFFERENT FROM THE sv_cvar VALUE.
default_valueThe string of the default value for the cvar.
saveBoolean of whether or not the value is persistent across map changes.
notifyBoolean of whether or not value changes are announced on the server
accessThe string of the access required for a client to actually change the value.

Returns

The server-side cvar object.

function playDenySound(ply)
Takes care of playing the “access denied” sound to a client.
function getUIDOwnedEnts(uid)
Gets a table of entities this uid owns.
function replicatedWritableCvar(sv_cvar,
cl_cvar,
default_value,
save,
notify,
access)
This function is mainly intended for use with the menus.
Close