Shared definition of the cw_emptycrate entity of the Ration Factory plugin, with the networked ration count and full flag and IsFull.

Originally written for the Iron Wall community.

Summary

Methods

Flags the crate full once it holds ten rations.
Draw()client
Draws the crate's model.
Explode()server
Plays the effect and sound of the crate breaking apart.
Draws how many of the ten rations the crate holds when the player looks at it.
Sets up the empty crate with 50 health and no rations inside.
IsFull()shared
Returns whether the crate has been flagged full.
Takes damage off the crate's health and breaks it when the health runs out.
Sets up the networked ration count and full flag.
Packs a touching full cw_emptyration into the crate, at most one per second.
Makes the crate always transmit to clients.

Methods

Flags the crate full once it holds ten rations.

Draws the crate's model.

Plays the effect and sound of the crate breaking apart.

Draws how many of the ten rations the crate holds when the player looks at it.

Parameters

  • x
  • y
  • alpha

Sets up the empty crate with 50 health and no rations inside.

Returns whether the crate has been flagged full.

Returns

  • Boolean Whether the crate is full

Takes damage off the crate's health and breaks it when the health runs out.

Parameters

  • damageInfo

Sets up the networked ration count and full flag.

Packs a touching full cw_emptyration into the crate, at most one per second.

At ten rations the crate turns into a shipment of ten ration_standard items. The packet is flagged as it is packed: it only disappears at the end of the tick, and a second crate that touches it could count it until then.

Parameters

  • ent

Makes the crate always transmit to clients.

Defined in