Entity
Shared Entity Metafunctions.
- SharedEntity:Distance(ent) → numberSource ☍
-
Check scalar distance to another entity.
Parameters
- entEntityThe entity to check distance for.
Returns
- numberdistance from the other entity.
- SharedEntity:DistToSqr(ent) → numberSource ☍
-
Check squared scalar distance to another entity.
Parameters
- entEntityThe entity to check distance for.
Returns
- numbersquared distance from the other entity.
- SharedEntity:GetNetVar(name, default) → anySource ☍
-
Reads a networked value from this entity. Unregistered names and Global-scoped vars both return
defaultwith a logged error -- usecityrp.network.GetGlobalfor Global-scoped vars.Parameters
- namestringThe registered var name.
- defaultanyReturned if the value has never been set, or on any of the error paths above.
Returns
- any
- SharedEntity:LLSpeed() → numberSource ☍
-
Gets the Photon Speed if photon is installed, otherwise uses the same formulae that photon uses.
Returns
- numberin "MPH".
- SharedEntity:LLSpeedKMH() → numberSource ☍
-
kmh readout of LLSpeed.
Returns
- numberin "KMH".
- SharedEntity:SetColor(ctab)Source ☍
-
Overwritten SetColor function to prevent d3d signs from being made invisible.
Parameters
- ctabColorThe colour table to be set.
- ServerEntity:SetNetVar(name, value)Source ☍
-
Sets a networked value on this entity and, if it changed, sends the update. Errors (logged, not thrown) for an unregistered name, a Global-scoped var (use
cityrp.network.SetGlobal), or a LocalPlayer-scoped var set on a non-player.Parameters
- namestringThe registered var name.
- valueanyThe new value.
nilclears it.
- SharedEntitySource ☍
-
The entity metatable, with CityRP's own additions to Garry's Mod's
Entity.
- SharedEntity.__netvarsSource ☍
-
Networked values set locally or received over the network, by var name.
niluntil the first value is stored.