CityRP Documentation Repository

core.plugins.maintenance.entities.cityrp_rockfall.shared

Name: "Rockfall Entity". Product: "CityRP 2 (Roleplay)". Description: A rockfall that needs to be cleaned up by a maintenance worker with a shovel.

Functions

SharedENT:BeginRise(finalPos)Source ☍

Begin rising from underground to its final resting position.

Parameters

  • finalPosVectorThe resting position the rockfall should end up at.
SharedENT:CleanUp(ply)Source ☍

Clean up this rockfall and reward the player.

Parameters

  • plyPlayerThe player cleaning up the rockfall
SharedENT:GetRiseDepth() → numberSource ☍

Returns how far underground the rockfall should start, based on the model's height.

Returns

  1. number
SharedENT:IsRising() → booleanSource ☍

@return rising — Whether the rockfall is still emerging and not yet fixable.

Returns

  1. booleanWhether the rockfall is still emerging and not yet fixable.
SharedENT:MoveTo(pos)Source ☍

Moves the physics object directly, since Entity:SetPos() alone won't drag it along.

Parameters

SharedENT:SpawnFunction(ply, tr, className) → Entity?Source ☍

Spawns a rockfall from the entity menu at the aimed-at surface.

Parameters

  • plyPlayerThe spawning player.
  • trtableEye trace of the spawn attempt.
  • classNamestringClass being spawned.

Returns

  1. Entity?
SharedENT:Think()Source ☍

Advances the rise animation, clearing the rising flag once it lands.

Fields

SharedENT._riseDurationSource ☍
SharedENT._riseStartSource ☍
SharedENT._riseStartPosSource ☍
SharedENT._riseTargetPosSource ☍
SharedENT._risingSource ☍