Summary

Methods

Checks whether a player may drive the entity, as the CPPI asks for it.
Checks whether a player may pick the entity up with the physics gun, as the CPPI asks for it.
Checks whether a player may use a property of the context menu on the entity, as the CPPI asks for it.
Checks whether a player may use a tool on the entity, as the CPPI asks for it.
Returns the owner of the entity, as the CPPI asks for it.
Gives the entity to the active character of a player, as the CPPI asks for it.
Returns the player the entity belongs to.
Returns the key of the character the entity belongs to.
Checks whether the entity belongs to the active character of a player.
Gives the entity to the active character of a player, or to nobody.

Methods

Checks whether a player may drive the entity, as the CPPI asks for it.

Parameters

  • actor Player

Returns

  • Boolean

Entity:CPPICanPhysgun(actor)

shared plugins/propprotection/plugin/lib/meta/sh_entity.lua:52

Checks whether a player may pick the entity up with the physics gun, as the CPPI asks for it.

Parameters

  • actor Player

Returns

  • Boolean

Entity:CPPICanProperty(actor, property)

shared plugins/propprotection/plugin/lib/meta/sh_entity.lua:69

Checks whether a player may use a property of the context menu on the entity, as the CPPI asks for it.

Parameters

  • actor Player
  • property String property name

Returns

  • Boolean

Entity:CPPICanTool(actor, tool)

shared plugins/propprotection/plugin/lib/meta/sh_entity.lua:60

Checks whether a player may use a tool on the entity, as the CPPI asks for it.

Parameters

  • actor Player
  • tool String tool ID

Returns

  • Boolean

Returns the owner of the entity, as the CPPI asks for it.

Returns

  • Player the owner, or nil if the entity belongs to nobody or its owner is not connected on the character that owns it; String the ownership key as the unique ID of the owner, nil if the entity belongs to nobody

Gives the entity to the active character of a player, as the CPPI asks for it. Server only.

Parameters

  • owner Player optional, defaults to nil the new owner; the entity is released when nil

Returns

  • Boolean true if the entity now belongs to the player or, when it was released, if it had an owner

See also

Returns the player the entity belongs to.

Returns

  • Player the owner, or nil if the entity belongs to nobody or its owner is not connected on the character that owns it

Entity:get_prop_owner_key()

shared plugins/propprotection/plugin/lib/meta/sh_entity.lua:90

Returns the key of the character the entity belongs to.

Returns

  • String ownership key, see PropProtection:get_key; nil if the entity belongs to nobody

Entity:is_prop_owner(target)

shared plugins/propprotection/plugin/lib/meta/sh_entity.lua:109

Checks whether the entity belongs to the active character of a player.

if entity:is_prop_owner(actor) then
  entity:Remove()
end

Parameters

  • target Player

Returns

  • Boolean

Entity:set_prop_owner(target, permanent)

server plugins/propprotection/plugin/lib/meta/sh_entity.lua:123

Gives the entity to the active character of a player, or to nobody. Server only.

Parameters

  • target Player optional, defaults to nil the new owner; the entity is released when nil
  • permanent Boolean optional, defaults to nil true to keep the entity when its owner leaves

Returns

  • Boolean true if the entity now belongs to the player or, when it was released, if it had an owner

See also

Defined in