Raised This Month: $98 Target: $400

[L4D1 & L4D2] Selfie Camera [v1.0.0 | 06-June-2021]

Post New Thread Reply   
Thread Tools Display Modes
Veteran Member
Join Date: Jan 2019
Location: Brazil
Plugin ID:
Plugin Version:
Plugin Category:
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Turns the camera into selfie mode
    Old 06-06-2021 , 12:20   [L4D1 & L4D2] Selfie Camera [v1.0.0 | 06-June-2021]
    Reply With Quote #1


    This plugin turns the camera into selfie mode.

    When the character moves, the camera is turned off.

    Based on the L4D2 Workshop Addon Selfie Camera by Sw1ft.

    • Allow configuring a default distance for the selfie camera.
    • Allow configuring a maximum distance for the selfie camera.
    • Allow clients manually set their camera distance. (through sm_selfie [distance] command)



    A configuration file named "l4d_selfie_camera.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

    PHP Code:
    // Default distance from client when enable the selfie camera.
    // -
    // Default: "50"
    // Minimum: "0.000000"
    l4d_selfie_camera_distance "50"

    // Max distance from client when enable the selfie camera.
    // 0 = Unlimited.
    // -
    // Default: "150"
    // Minimum: "0.000000"
    l4d_selfie_camera_distance_max "150"

    // Enable/Disable the plugin.
    // 0 = Disable, 1 = Enable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_selfie_camera_enable "1" 
    Public Commands
    • sm_selfie [distance] => Change the camera to the selfie mode.

    Admin Commands
    • sm_print_cvars_l4d_selfie_camera => Print the plugin related cvars and their respective values to the console. (z flag required)

    Change Log


    • Glows aren't visible while selfie mode is turned on.
    • When the character moves, the camera is turned off.
    • This plugin uses a "point_viewcontrol_survivor" entity to simulate the camera for each client.
    • It may look a bit laggy for high latency clients.
    • Sometimes the camera may attach to a random common when the player dies. (unknown cause)
    • point_viewcontrol makes the player invulnerable while enabled on camera, point_viewcontrol_survivor/point_viewcontrol_multiplayer don't.

    Thank you!

    Related Plugins

    Related Workshop Addons

    Post Reply
    • Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.

    • Put the "l4d_selfie_camera.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_selfie_camera.sp - 126 views - 12.8 KB)

    Last edited by Marttt; 01-15-2023 at 12:20.
    Marttt is offline
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 06-06-2021 , 15:14   Re: [L4D1 & L4D2] Selfie Camera [v1.0.0 | 06-June-2021]
    Reply With Quote #2

    Nice one, Marttt!

    That was the thing I also wanted to implement, but never had a time for that.

    You used "point_viewcontrol" which seems more suitable than my idea with parented dummy entity + SetClientViewEntity.

    All at all, great work!

    BTW, this is irreplaceable thing for Left 4 Dead 1, where programmatic change player view to 3rd person is impossible.
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 06-06-2021 at 15:19.
    Dragokas is offline
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-06-2021 , 15:20   Re: [L4D1 & L4D2] Selfie Camera [v1.0.0 | 06-June-2021]
    Reply With Quote #3

    Yeah great demonstration of point_viewcontrol, so simple but effective. Something I only tested out in private plugins which introduced motion sickness haha. Good job, thanks for sharing!
    Silvers is offline
    Junior Member
    Join Date: Jan 2014
    Old 06-07-2021 , 15:25   Re: [L4D1 & L4D2] Selfie Camera [v1.0.0 | 06-June-2021]
    Reply With Quote #4

    Just as extra information, view control entity has no bridge with glows. I tried this method before, but its only for simple things.
    th3y is offline
    New Member
    Join Date: Oct 2021
    Old 10-08-2021 , 06:56   Re: [L4D1 & L4D2] Selfie Camera [v1.0.0 | 06-June-2021]
    Reply With Quote #5

    Hello, thanks for the information.
    RobertHWhitlock is offline

    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump

    All times are GMT -4. The time now is 13:38.

    Powered by vBulletin®
    Copyright ©2000 - 2023, vBulletin Solutions, Inc.
    Theme made by Freecode