PhysObj.ClearGameFlag

From GMod Wiki

Revision as of 11:44, 24 November 2010 by SiPlus (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax PhysObj.ClearGameFlag( Number flag )
Description:
Clears an engine game flag from a physics object.
Returns: nil
In Object: Physobj
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=PhysObj.ClearGameFlag]PhysObj.ClearGameFlag [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPrevents thrown objects from exploding/sticking-into-things.
Used onNewerServer.png
Code
function noThrow(ply,ent)
	if ply:KeyDown(IN_ATTACK) then
		-- they're trying to throw it
		local phy = ent:GetPhysicsObject()
		if phy:IsValid() then phy:ClearGameFlag(FVPHYSICS_WAS_THROWN) end
	end
end
 
hook.Add( "GravGunOnDropped", "noThrow",noThrow)
OutputN/A


Additional Notes

SHARED | 0000000000000001 | 00000000000000001 | DMG_SLICE
SHARED | 0000000000000002 | 00000000000000010 | CONSTRAINT_STATIC
SHARED | 0000000000000004 | 00000000000000100 | PLAYER_HELD
SHARED | 0000000000000008 | 00000000000001000 | PART_OF_RAGDOLL
SHARED | 0000000000000016 | 00000000000010000 | MULTIOBJECT_ENTITY
SHARED | 0000000000000032 | 00000000000100000 | HEAVY_OBJECT
SHARED | 0000000000000064 | 00000000001000000 | PENETRATING
SHARED | 0000000000000128 | 00000000010000000 | NO_PLAYER_PICKUP
SHARED | 0000000000000256 | 00000000100000000 | WAS_THROWN
SHARED | 0000000000000512 | 00000001000000000 | DMG_DISSOLVE
SHARED | 0000000000001024 | 00000010000000000 | NO_IMPACT_DMG
SHARED | 0000000000002048 | 00000100000000000 | NO_NPC_IMPACT_DMG
SHARED | 0000000000032768 | 01000000000000000 | NO_SELF_COLLISIONS

See also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox