base.sh_base_place

Placeable base item This is intended to act as a generic base or template for placeable items (placing items down as an entity)

Functions

GetCanPhysgun()

View source »

Gets if this item can be physgunned. If true, the owner of this entity (in prop protection) will be the player who placed it.

GetCanPickup()

View source »

Gets if this item can be picked up again

GetCrashProtect()

View source »

Gets if the item should have crash protection enabled

GetEntityClass(The)

View source »

Gets the classname of the entity to spawn.

Parameters

  • The string

    classname of the entity to spawn.

GetForceEntityModel()

View source »

Gets if the entity model should be set to the item

GetOverrideInvRemoval()

View source »

Gets if the item should stay in the inventory when placed. You should not touch this unless you know what you're doing, as it can cause duplication exploits!

Placeable(classname, canPickup, canPhysgun)

View source »

Mark this item placeable.

Parameters

  • classname string

    The classname of the entity to spawn.

  • canPickup boolean or nil

    If the item can be picked up after being placed.

  • canPhysgun boolean or nil

    If the item can be physgunned by the owning player after being placed.

PostPickup(client, item)

View source »

This is designed to be overriden by anything inheriting this base item

Parameters

  • client Player

    The player placing the item

  • item Item

    The item being placed

PostPlace(client, entity, item)

View source »

This is designed to be overriden by anything inheriting this base item

Parameters

  • client Player

    The player placing the item

  • entity Entity

    The spawned entity to represent the placed item

  • item Item

    The item being placed

SetCanPhysgun(canPhysgun)

View source »

Sets if this item can be physgunned. If true, the owner of this entity (in prop protection) will be the player who placed it.

Parameters

  • canPhysgun bool

    If the item can be physgunned, will also set entity owner to player.

SetCanPickup(canPickup)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

View source »

Sets if this item can be picked up again.

Parameters

  • canPickup bool

    If the item can be picked up after being placed.

See Also

SetCrashProtect(crashProtect)

View source »

Sets if the item should have automatic crash protection enabled (default false). Items with this enabled will also be removed if the owner disconnects to prevent duplication exploits.

Parameters

  • crashProtect bool

SetEntityClass(classname)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

View source »

Sets the classname of the entity to spawn.

Parameters

  • classname string

    The classname of the entity to spawn.

See Also

SetForceEntityModel(If)

View source »

Sets if the entity model should be set to the item

Parameters

  • If bool

    the entity model should be set to the item

SetOverrideInvRemoval(keepInInv)

View source »

Sets if the item should stay in the inventory when placed. You should not touch this unless you know what you're doing, as it can cause duplication exploits!

Parameters

  • keepInInv bool

TogglePlacementState(state, ent, item)

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Parameters

  • state boolean

  • ent Entity

  • item Item

canPickup(client, oSid, entity, item)

View source »

Called to validate if the player can pick up this item

Parameters

  • client Player

  • entity Entity

  • item Item

Returns

canPlace(client, pos, angles, item)

View source »

Called before an item is placed to see if it can be done

Parameters

  • client Player

    The player placing this item (also owner of item)

  • pos Vector

    The position they wish to place it at

  • angles Angle

    The angles they wish to place it at

  • item Item

    The item they're attempting to place (actual item, not base)

Returns

onPickup(client, entity, item)

View source »

Called to perform any logic when an item is succesfully being picked up

Parameters

  • client Player

    The player picking up the item

  • entity Entity

    The entity that represents the placed item

  • item Item

    The item being picked up

Returns

  • boolean or nil success

    If the pickup is successful

onPlace(client, pos, angles, item)

View source »

Called when an item is being placed

Parameters

  • client Player

    The player placing this item (also owner of item)

  • pos Vector

    The position they wish to place it at

  • angles Angle

    The angles they wish to place it at

  • item Item

    The item they're attempting to place (actual item, not base)

Returns

  • Entity or nil placedEnt The entity representing the item that has been placed, invalid will result in action being cancelled

Tables

base_place

View source »
Incomplete

Documentation for this section is incomplete and needs expanding.

Fields

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed

  • self fun(self:

    ): GetOverrideInvRemoval boolean Gets if the item should stay in inventory when placed