Garry's Mod Wiki

Entity:HasSpawnFlags

boolean Entity:HasSpawnFlags( number spawnFlags )

Description

Returns whether this entity has the specified spawnflags bits set.

Arguments

1 number spawnFlags
The spawnflag bits to check, see Enums/SF.

Returns

1 boolean
Whether the entity has that spawnflag set or not.

Example

As seen in sandbox's PhysgunPickup hook.

function GM:PhysgunPickup( ply, ent ) -- Don't move physboxes if the mapper logic says no if ( ent:GetClass() == "func_physbox" && ent:HasSpawnFlags( SF_PHYSBOX_MOTIONDISABLED ) ) then return false end return true end

Page Links


Special Pages


Wikis

?

Render Time: 31ms

DB GetPage 2
Generate Html 7
SaveChanges (1) 8
Render Body 0
Render Sidebar 11