Garry's Mod Wiki

Revision Difference

GM:PlayerSwitchFlashlight#511230

<function name="PlayerSwitchFlashlight" parent="GM" type="hook">⤶ <ishook>yes</ishook>⤶ <description>Called whenever a player attempts to either turn on or off their flashlight, returning false will deny the change.</description>⤶ <realm>Server</realm>⤶ <args>⤶ <arg name="ply" type="Player">The player who attempts to change their flashlight state.</arg>⤶ <arg name="enabled" type="boolean">The new state the player requested, true for on, false for off.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="boolean">Can toggle the flashlight or not</ret>⤶ </rets>⤶ </function>⤶ ⤶ <note>Also gets called when using <page>Player:Flashlight</page>.</note>