Garry's Mod Wiki

ENTITY:UpdateTransmitState

ENTITY:UpdateTransmitState

  number ENTITY:UpdateTransmitState()

Description

Called whenever the transmit state should be updated.

Returns

1 number
Transmit state to set, see Enums/TRANSMIT.

Example

Entity pickup example, stops the entity from being networked after it's been picked up, and restores it once it "respawns".

function ENT:Touch( other ) if ( self.NextRespawn > CurTime() ) then return end self.NextRespawn = CurTime() + 5 self:AddEFlags( EFL_FORCE_CHECK_TRANSMIT ) end function ENT:UpdateTransmitState() if ( self.NextRespawn > CurTime() ) then return TRANSMIT_NEVER end return TRANSMIT_PVS end function ENT:Think() if ( self.NextRespawn != -1 && self.NextRespawn < CurTime() ) then self.NextRespawn = -1 self:AddEFlags( EFL_FORCE_CHECK_TRANSMIT ) end end

Special Pages


Wikis

?

Render Time: 51ms

DB GetPage 25
Generate Html 3
SaveChanges (1) 15
Render Body 0
Render Sidebar 6