Garry's Mod Wiki

Revision Difference

WEAPON:GetCapabilities#512178

<function name="GetCapabilities" parent="WEAPON" type="hook">⤶ <ishook>yes</ishook>⤶ <description>This hook is for NPCs, you return what they should try to do with it.</description>⤶ <realm>Server</realm>⤶ <rets>⤶ <ret name="" type="number">A number defining what NPC should do with the weapon. Use the <page>CAP</page>.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>As defined in weapon_base</description>⤶ <code>⤶ function SWEP:GetCapabilities()⤶ ⤶ return bit.bor( CAP_WEAPON_RANGE_ATTACK1, CAP_INNATE_RANGE_ATTACK1 )⤶ ⤶ end⤶ </code>⤶ ⤶ </example>