PhysObj.HasGameFlag

From GMod Wiki

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



Examples

DescriptionSays is the physics object under crosshair part of ragdoll or not.
Used onNewerClient.png
Code
 
local phy = LocalPlayer():GetEyeTrace().Entity:GetPhysicsObject()
if phy:IsValid() then
    if phy:HasGameFlag(PART_OF_RAGDOLL) then
        LocalPlayer():ChatPrint("Is part of ragdoll")
    else
        LocalPlayer():ChatPrint("Isn't part of ragdoll")
    end
end
 
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