Gamemode.PlayerSwitchFlashlight

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerSwitchFlashlight
SyntaxGM:PlayerSwitchFlashlight( Player ply, Boolean SwitchOn )
DescriptionCalled when a player uses their flashlight.
ReturnsWhether the player can use their flashlight.
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSwitchFlashlight]Gamemode.PlayerSwitchFlashlight [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionDetermine whether or not a player can use their flashlight.
Used onNewerServer.png
Code
 
function GM:PlayerSwitchFlashlight(ply, SwitchOn)
     return ply:IsAdmin() or not SwitchOn
end
 
OutputOnly admins can turn their flashlight on.


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox