Library propprotection
Prop protection library.
Functions
| isAllowedForEntity( ent, accessType ) | Returns true if the given action is permitted against the given entity for the owner of this instance, false otherwise. |
| isAllowedForPlayer( ply, accessType ) | Returns true if the given action is permitted against all entities owned by the given player for the owner of this instance, false otherwise. |
| isGrantedForEntityToPlayer( ent, accessType, ply ) | Returns true if the given player can perform the given action against the given entity (owned by the owner of this instance), false otherwise. |
| isGrantedToPlayer( ply, accessType ) | Returns true if the given action is permitted for the given player against all entities owned by the player that owns this instance, false otherwise. |
Fields
| ACCESS_DUPLICATOR | Permission to use the duplicator tool with an entity. |
| ACCESS_GRAVITY_GUN | Permission to use the gravity gun with an entity. |
| ACCESS_PHYSGUN | Permission to use the physgun with an entity. |
| ACCESS_TOOLGUN | Permission to use the toolgun with an entity (excluding the duplicator tool). |
| ACCESS_USE | Permission to use an entity (pressing the use key). |
Functions
- propprotection.isAllowedForEntity( ent, accessType )
-
Returns true if the given action is permitted against the given entity for the owner of this instance, false otherwise.
Environment:
ServerParameters:
-
(Entity) ent: The entity to query access against. -
(string) accessType: The type of access to check (one of propprotection.ACCESS_*).
-
- propprotection.isAllowedForPlayer( ply, accessType )
-
Returns true if the given action is permitted against all entities owned by the given player for the owner of this instance, false otherwise.
Environment:
ServerParameters:
-
(Player) ply: The player to query access against. -
(string) accessType: The type of access to check (one of propprotection.ACCESS_*).
-
- propprotection.isGrantedForEntityToPlayer( ent, accessType, ply )
-
Returns true if the given player can perform the given action against the given entity (owned by the owner of this instance), false otherwise.
Environment:
ServerParameters:
-
(Entity) ent: The entity to query access against (must be owned by the instance owner). -
(string) accessType: The type of access to check (one of propprotection.ACCESS_*). -
(Player) ply: The player to check for granted access.
-
- propprotection.isGrantedToPlayer( ply, accessType )
-
Returns true if the given action is permitted for the given player against all entities owned by the player that owns this instance, false otherwise.
Environment:
ServerParameters:
-
(Player) ply: The player to check for granted access. -
(string) accessType: The type of access to check (one of propprotection.ACCESS_*).
-