Raised This Month: $ Target: $400

[L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.4 | 22-January-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:
    Replaces normal cars with car alarms
    Old 01-08-2021 , 23:30   [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.4 | 22-January-2021]
    Reply With Quote #1


    This plugin replaces normal cars with car alarms.

    It was heavily inspired and borrowed a lot of code from the [L4D1&2] Spawn Alarmcars plugin.

    • Configuring the color of the replaced car.
    • Configuring the chance to an existing car become a car alarm.
    • Configuring which models should be considered as valid cars to replace.
    • Configuring which parts of the car alarm context should be spawned.


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

    PHP Code:
    // Chance of a normal car be replaced by the plugin.
    // -
    // Default: "100.0"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_replace_car_alarm_chance "100.0"

    // Chirp sound. Sound that plays when someone shoots near a car before the car alarm starts.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_chirp "1"

    // Car alarm color.
    // "palette" = colors used by cars on official maps.
    // "maintain" = keep original car color ("pallete" if colorless).
    // "random" = random colors.
    // "<0-255> <0-255> <0-255>" = specific car color. (e.g: "138 37 9", default car alarm color).
    // -
    // Default: "maintain"
    l4d_replace_car_alarm_color "maintain"

    // Enable/Disable the plugin.
    // 0 = Disable, 1 = Enable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_enable "1"

    // Game event. A instructor hint may warn about the car alarm.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_game_event "0"

    // Normal car glass when the car alarm starts.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_glass_off "1"

    // Blinking car glass until the car alarm starts.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_glass_on "1"

    // Headlights at front when the car alarm starts.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_headlights "1"

    // Ignore prop_car_alarm entities while replacing.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_ignore_car_alarm "1"

    // Lights at front and back when the car alarm starts.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_lights "1"

    // Remark. Survivors may warn about the car alarm through vocalizers.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_remark "0"

    // Car alarm sound when the car alarm starts.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_sound "1"

    // Keep original targetname.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_targetname "0"

    // Timer that controls the lights and headlights during the car alarm.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_replace_car_alarm_timer "1" 
    Valid models

    File that goes at "\addons\sourcemod\data\" folder.


    Entities created by car

    You can disable each one (except the car) in through cvars.


    Admin Commands
    • sm_car_alarm_reload => Reload the valid models file to replace into car alarms. (z flag required)
    • sm_car_alarm_refresh => Refresh the car alarms replace chance. (z flag required)
    • sm_print_cvars_l4d_replace_car_alarm => Print the plugin related cvars and their respective values to the console. (z flag required)

    Change Log


    • Cars that are static (compiled with the map) can't be replaced, this isn't a bug.
    • All replaced cars has the same model. (models/props_vehicles/cara_95sedan.mdl)
    • The plugin ignores cars that start with "PP_" on Questionable Ethics 1 (2nd Map).
    • The plugin ignores cars that start with "car*&" on Glubstatic 1 (3rd Map).
    • prop_dynamic entities aren't considered in this plugin cause usually they bug when replaced. (not meant to have physics in most of cases, examples below)
    • Dead Air (4th Map) - there is a van (prop_dynamic - hammerid 2388979) that is not replaced. When replaced the event stops working.
    • Sacrifice (3rd Map) - there is a car (prop_dynamic - hammerid 5587943) next to the stairs used to lift the bridge that is not replaced. When replaced the car bugs in the map.

    Known Issues
    • You can reach the maximum entity limit very fast if the map has a lot of cars to replace. Every replaced car creates more 14 entities with all cvars enabled. (and, of course, deletes the previous car entity)
    • Some cars don't maintain the color (appears as white) cause the map script (case_car_color) applies a random color too late for detection. The plugin apply a pallete color on these cases.
    • The replaced car may not fit the same position from the previous model, because they may have different sizes.
    • Some models are also rotated because their original model has different angles.
    • In L4D1 seems that you can't trigger alarms so often, so when hitting a car alarm, you may have to wait for the next one trigger the alarm.
    • May not work properly in some custom maps (let me know if you find one).
    • May not work properly with Stripper modifications (like Sky events), because there is no parentname in some entities related to the car, usually, when that happens you can see a car glass floating next to the alarm car.
    • In case you enable the targetname cvar to maintain the original, if there are cars with duplicated targetnames, the alarm car won't work properly.

    To Do
    • Allow car alarms to become random too (without an alarm).
    • Add support for versus matches (make the same cars with alarm).

    Thank you!

    Related Plugins

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

    • Put the "l4d_replace_car_alarm.cfg" file in your "\addons\sourcemod\data\" folder.
    • Put the "l4d_replace_car_alarm.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
    Attached Files
    File Type: cfg l4d_replace_car_alarm.cfg (2.5 KB, 423 views)
    File Type: sp Get Plugin or Get Source (l4d_replace_car_alarm.sp - 258 views - 43.1 KB)

    Last edited by Marttt; 02-19-2023 at 22:54.
    Marttt is offline
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 01-09-2021 , 12:49   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.0 | 09-January-2021]
    Reply With Quote #2

    Nice idea! Thanks.
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Junior Member
    Join Date: Aug 2013
    Old 01-14-2021 , 07:04   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.0 | 09-January-2021]
    Reply With Quote #3

    btw: When an alarm car is hit by a tank, the light is still blinking. Usually it would be turned off. But the alarm is off. just a little cosmetic bug.

    Anyway, thanks for the plugin!
    Merc1less is offline
    Senior Member
    Join Date: Mar 2019
    Old 01-17-2021 , 03:56   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.1 | 14-January-2021]
    Reply With Quote #4

    Marttt can you fix [L4D1&2] Spawn Alarmcars ?
    JLmelenchon is offline
    AlliedModders Donor
    Join Date: Jan 2021
    Location: dcord:Jeremy333#7632
    Old 01-18-2021 , 10:16   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.1 | 14-January-2021]
    Reply With Quote #5

    Hi, I'm very grateful with your job,

    I came to report that
    I just had a problem on my server
    about physics since 16/01
    which was a segmentation fault
    Segmentation fault (core dumped)

    warning: Can't read pathname for load map: Input/output error.
    email debug.log to [email protected]

    via Accelerator
    Got a presubmit token from server:
    Uploaded crash dump:
    This is the message
    engine_srv.so!_ZL31CM_GetCollideableTriggerTe stBoxP12ICollideableP6VectorS2_b.constprop.49 + 0xa0

    Well, a friend of mine asked me to play glubtastic so we have,
    and it was in the map glubtastic_3 which is a highway,
    I noted that the cars were not having the expected behaviour,
    I also got the throttle crash log,
    I did multiple test with a lot of plugins until I, with a lot of sorrow,
    remove l4d_replace_car_alarm.smx

    So, I tested the map and it's working now, I will report if
    my server is stable now or maybe I got the same error again
    in another map without the plugin,

    I'm sharing for everyone that got this crash log message
    because I just found one message and I think that is related,

    jeremyvillanueva is offline
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 01-18-2021 , 13:04   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.2 | 18-January-2021]
    Reply With Quote #6

    JLmelenchon, try this Spawn Alarmcars version.

    Last edited by Marttt; 03-07-2021 at 16:21.
    Marttt is offline
    Senior Member
    Join Date: Nov 2015
    Location: Peaceful place of the in
    Old 01-21-2021 , 00:27   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.3 | 20-January-2021]
    Reply With Quote #7

    Do you think you can add info_remarkable with remark_caralarm context above on the car alarms? So the survivors can warn there is car alarm in sight.

    Edit: Thanks a lot

    Last edited by Edison1318; 01-23-2021 at 02:42.
    Edison1318 is offline
    Send a message via Skype™ to Edison1318
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 01-22-2021 , 17:43   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.4 | 22-January-2021]
    Reply With Quote #8

    @Edison1318, I added it to the new version.

    The cvar starts disabled by default l4d_replace_car_alarm_remark set to "1" to apply.

    Btw, I wasn't able to make it warn more than once per map even changing the vanilla game cvar rr_remarkable_world_entities_replay_limit to higher values. [default: 1] (Maybe is a Valve bug)


    1.0.4 (22-January-2021)
        - Added info_remarkable entity. (thanks "Edison1318" for requesting)
        - Added info_game_event_proxy entity.
        - Added proper entities kill on OnCarAlarmEnd/OnHitByTank.
        - Added pallete color.

    Last edited by Marttt; 01-22-2021 at 21:36.
    Marttt is offline
    Senior Member
    Join Date: Dec 2017
    Location: Thy old times.
    Old 06-18-2023 , 11:35   Re: [L4D1 & L4D2] Replace Cars Into Car Alarms [v1.0.4 | 22-January-2021]
    Reply With Quote #9

    When the map starts for the first time, all cars will be replaced with car alarms. No exceptions. If the map gets restarted (all survivors dead for example), the plugin starts functioning correctly (according to the .cfg).

    No errors or anything in the log.

    This has been a thing for forever, but I kept forgetting to report it. :s

    Last edited by KoMiKoZa; 06-18-2023 at 11:36.
    KoMiKoZa 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 21:51.

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