Player class
Part of Shared Flashlight
Player extensions of the Shared Flashlight plugin: reading and changing the player's flashlight, whichever flashlight is in use. The state is a networked variable of the player, so it is read on both realms, but it is only changed on the server.
Summary
Methods
shared_flashlight_enabled config is off, the engine one.Methods
Returns the entity of the player's shared flashlight.
Returns
- Entity the fl_flashlight entity, or nil while the shared flashlight is off or its entity has not reached the client yet
Checks whether the player's flashlight is on: the shared flashlight or, while the
shared_flashlight_enabled config is off, the engine one.
Returns
- Boolean
Turns the player's flashlight on or off and runs the PlayerFlashlightChanged hook.
Does nothing clientside. While the shared_flashlight_enabled config is on, turning the
flashlight on creates an fl_flashlight entity parented to the player, which is removed
along with the player, and turning it off removes that entity; the engine flashlight is
put out either way, in case the config was turned on while it was lit. While the config
is off the engine flashlight is toggled instead.
Parameters
- on Boolean true to turn the flashlight on, false to turn it off