Entity.GetSpawnFlags
From GMod Wiki
Revision as of 22:55, 3 August 2011 by ๖ۣۜArKaиiuM (Talk | contribs)
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: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.GetSpawnFlags]Entity.GetSpawnFlags [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- Unless spawnflags are set in the entity's spawn list entry, most entities will return nil when spawned in the game using the Q menu.
- Here the number 131072 corresponds to the numerical value of the spawnflag, SF_CITIZEN_MEDIC, which could have been used instead.
- Note that an npc with any combination of spawnflags will work with this code due to the way spawnflags are designed. So for this example an npc_citizen with the spawnflags 393736 ( Drop Healthkit, Fade Corpse, Medic, Random Head ) will still return true.