Entity.GetSpawnFlags

From GMod Wiki

Revision as of 22:55, 3 August 2011 by ๖ۣۜArKaиiuM (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:GetSpawnFlags( )
Description:
Returns the total spawn flags, set in Hammer, or a 'SpawnFlags = ' statement in the spawn list.
Returns: number
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetSpawnFlags]Entity.GetSpawnFlags [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionReturns true if an entity has a specific spawnflag, here the npc_citizen's Medic spawnflag, otherwise false.
Used onNewerShared.png
Code
function IsMedic( ent )
 
    if !ent:IsValid() then return false end
 
    local sClass = ent:GetClass()
    if sClass != "npc_citizen" then return false end
 
    return  ( ent:GetSpawnFlags() & 131072 ) 
end
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox