Raised This Month: $319 Target: $400
 79%   Almost there!

[L4D1 AND L4D2] Machine Gun System(02/22/2021)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Ernecio
Member
Join Date: Sep 2019
Location: The United Mexican State
Plugin ID:
7504
Plugin Version:
4.2
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Create machine guns of different types with automatic control.
    Old 02-17-2021 , 20:10   [L4D1 AND L4D2] Machine Gun System(02/22/2021)
    Reply With Quote #1

    [L4D1 AND L4D2] Machine Gun System


    About
    Some time ago i used the Plugin [L4D & L4D2] Intelligent Machine Gun by Panxiaohai, i really liked the idea of an automatic control, but in Left 4 Dead 1 i had problems such as server crash after a while of using said Plugin, among some other errors, since its author has not been active for some years, i decided to make the fixes on my own.

    So i studied the code and saw that it could be improved more, after correcting the main problems that prevented me from using the Plugin in a correct way, i thought about adding new functions and other types of machine guns, this is how this plugin was created.

    Description
    Provides the ability to generate automatic control machine guns of different types through chat commands and menu.

    Machine guns can be created such as:

    Simple machine guns
    They have the ability to use special ammunition if stable, for example incendiary and explosive ammunition, or simply use normal ammunition, they can also be controlled by a player, they have an ammunition counter in case of being used by a user
    Note: single player control of these machine guns will not always be available, this feature is still in development.

    Flame
    It has the ability to inflict burn damage if it has an enemy in its proximity, the damage increases as the enemy is closer (It only affects the main enemy).
    When it's destroyed, it will spill the fuel it uses for the flare and will burn after the explosion.

    Laser
    It has the ability to shoot laser beams at its targets and damage them by energy beam.

    Tesla
    It has the ability to create electric arcs that are capable of disintegrating common zombies.
    When destroyed it can create electric arcs that will damage survivors and special infected in addition to an explosion.

    Freezing
    It has the ability to freeze special infected and survivors, the liquid nitrogen it uses is also somewhat unstable, so it must release pressure from time to time, so it can temporarily freeze special infected and survivors in its vicinity.

    Nauseating
    Has the ability to fire a bullet with Boomer's bile time to time (Only one target at time), which can fill Survivors and Tanks with vomit (Left 4 Dead 2 only).
    This machine gun when destroyed, will release all the Boomer's bile it has in its reserves, being able to splash survivors and Tanks (Only in Left 4 Dead 2)

    Screenshots
    Type Flame
    Type Laser
    Type Tesla
    Type Freezing
    Type Nauseating
    Simple Machine Gun

    How to create machine guns?
    !machine Creates a simple machine gun in front of the player.
    !machinemenu Open the machine gus menu with all types.
    !removemachine Removes the machine gun in the crosshairs.
    !resetmachine reloads the settings and remove all the spawned machine guns(Needs Admin Flag Root).

    Create specified Gatling machine gun quickly
    !machine 1 flame
    !machine 1 tesla
    !machine 1 laser
    !machine 1 freeze
    !machine 1 nauseating

    Create specified 50 Cal machine gun quickly
    !machine 2 flame
    !machine 2 tesla
    !machine 2 laser
    !machine 2 freeze
    !machine 2 nauseating

    Create specified simple machine gun quickly
    !machine 1 Creates a Gatling machine gun.
    !machine 2 Creates a 50 Cal machine gun.

    How to move and put ont floor a machine gun?
    To move a machine gun (only by its owner by default) press Duck and Shove (Ctrl + Right mouse button) on the machine gun.
    To put on the floor press Use (E) button for a moments

    Credits

    - Panxiaohai for his plugin [L4D & L4D2] Intelligent Machine Gun and his original idea.
    - Silvers for his code stocks in [L4D & L4D2] Prototype Grenades.
    - Marttt for his stock of code in his plugins.
    - Lux for his stock L4D_TE_Create_Particle.

    - Ah all of them thank you for your stock of code and plugins!
    (I've used other code references from the SourceMod forums, credits to their authors)

    Convars
    PHP Code:
    //****************************************************************************************************
    //                                 Activation and deactivation variables.
    //****************************************************************************************************

    // Enables/Disables the plugin. 0 = Plugin OFF, 1 = Plugin ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_machine_enable "1"

    // Enables/Disables the use of machine guns only in final events.
    // 0 = Finals OFF.
    // 1 = Finals ON
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_machine_finale_only "0"

    //****************************************************************************************************
    //                                     Game types and maps allowed
    //****************************************************************************************************

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    // -
    // Default: ""
    l4d_machine_gamemodes_on ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    // -
    // Default: ""
    l4d_machine_gamemodes_off ""

    // Turn on the plugin in these game modes.
    // 0 = All, 1 = Coop, 2 = Survival, 4 = Versus, 8 = Scavenge.
    // Add numbers together.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "15.000000"
    l4d_machine_gamemodes_toggle "0"

    // Allow the plugin being loaded on these maps, separate by commas (no spaces). Empty = all.
    // Example: "l4d_hospital01_apartment,c1m1_hotel"
    // -
    // Default: ""
    l4d_machine_maps_on ""

    // Prevent the plugin being loaded on these maps, separate by commas (no spaces). Empty = none.
    // Example: "l4d_hospital01_apartment,c1m1_hotel"
    // -
    // Default: ""
    l4d_machine_maps_off ""

    //***************************************************************************************************
    //                                         Ammo type and damage amount
    //***************************************************************************************************

    // Sets the amount of damage to the infected.
    // -
    // Default: "50"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_machine_damage_to_infected "50"

    // Sets the amount of damage to survivors.
    // -
    // Default: "50"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_machine_damage_to_survivor "50"

    // Sets the amount of ammo for each machine gun
    // -
    // Default: "2000"
    // Minimum: "100.000000"
    // Maximum: "10000.000000"
    l4d_machine_ammo_count "2000"

    // Sets ammunition type.
    // 0 = Normal Ammo.
    // 1 = Incendiary Ammo.
    // 2 = Explosive Ammo.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "2.000000"
    l4d_machine_ammo_type "0"

    // Sets the max number of machine guns allowed.
    // -
    // Default: "10"
    // Minimum: "1.000000"
    // Maximum: "32.000000"
    l4d_machine_max_allowed "10"

    // Sets the max range of enemy detection by machine guns.
    // -
    // Default: "1000"
    // Minimum: "250.000000"
    // Maximum: "3000.000000"
    l4d_machine_range "1000"

    // Sets the Machine Overheat according to the shooting speed, time in seconds.
    // -
    // Default: "10.0"
    // Minimum: "5.000000"
    // Maximum: "30.000000"
    l4d_machine_overheat "10.0"

    //****************************************************************************************************
    //                         Configuration of client and administrator access
    //
    //                         Consult the following link for more information:
    //                       https://wiki.alliedmods.net/Adding_Admins_(SourceMod)
    // 
    //****************************************************************************************************

    // Sets global access to machine guns by admin flags.
    // Empty = Allowed for everyone.
    // -
    // Default: ""
    l4d_machine_required_acces_level ""

    // Sets access to basic machine guns by admin flags.
    // 0 = Allowed for everyone.
    // -
    // Default: ""
    l4d_machine_basic_adminonly ""

    // Sets access to special machine guns by admin flags.
    // 0 = Allowed for everyone.
    // -
    // Default: ""
    l4d_machine_special_adminonly ""

    // Sets what special machine guns will be allowed
    // -
    // Default: "Flame,Laser,Tesla,Freeze,Nauseating"
    l4d_machine_special_allowed "Flame,Laser,Tesla,Freeze,Nauseating"

    //***************************************************************************************************
    //                                         Another variables
    //***************************************************************************************************

    // Sets the number of times it shows usage information.
    // 0 = Doesn't Shows Information.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "5.000000"
    l4d_machine_usage_message "1"

    // Enabless/Disabless reloading of machine guns.
    // 0 = Reload Disable.
    // 1 Reload Enable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_machine_ammo_reload "1"

    // Enabless/Disabless, Sets who can carry the machine guns.
    // 0 = Disable carry
    // 1 = Every One.
    // 2 = Only Creator.
    // -
    // Default: "2"
    // Minimum: "0.000000"
    // Maximum: "2.000000"
    l4d_machine_allow_carry "2"

    // Enabless/Disabless manual use of machine guns, only applies to basic machine guns.
    // 0 = Use Disabled.
    // 1 = Use Enabled.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_machine_allow_use "1"

    // Sets the max waiting time(seconds) to remain inactive a machine gun when there are no enemies in it's range.
    // -
    // Default: "300.0"
    // Minimum: "60.000000"
    // Maximum: "600.000000"
    l4d_machine_sleep_time "300.0"

    // Sest rate of fire, amount shots per soncod.
    // -
    // Default: "5"
    // Minimum: "5.000000"
    // Maximum: "30.000000"
    l4d_machine_fire_rate "5"

    // Sets the amount of health for each machine gun.
    // -
    // Default: "700"
    // Minimum: "50.000000"
    // Maximum: "1000.000000"
    l4d_machine_health "700"

    // Sets the probability of being betrayed by machine guns
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_machine_betray_chance "0"

    // Sets machine gun limit for each user.
    // -
    // Default: "4"
    // Minimum: "1.000000"
    // Maximum: "5.000000"
    l4d_machine_limit "4"

    // Sets the maximum amount of damage the explosion can cause when a machine gun has been removed.
    // 0 = Explosion Disabled.
    // -
    // Default: "10"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_machine_enable_explosion "10"

    // Sets the time a machine gun will be dropped.
    // Deafualt: 0.5
    // Minimun: 0.5
    // Maximun: 3.0
    l4d_machine_dropping_time "0.5" 
    Notes
    HTML Code:
    * The special ammunition can only be used in automatic mode, a user can only use normal ammunition,  still needs test in L4D2.
    * In L4D1 when trying to use a machine gun that is inaccessible, warnings can be thrown on the console, it doesn't affect the server / game.
    * Machine guns can get stuck in case of contact with a solid object, only relocating it will unblock it.
    * Non-special machine guns cannot always be used even if they are not firing.
    * In L4D1 nauseating type machine guns can only fire boomer bile at survivors, in L4D2 survivor and tanks.
    * Plugin without testing with more than 10 machine guns at the same time, it could crash the server / game if many are used at the same time.
    * Still requires testing with [L4D / L4D2] Lux's Model Changer, [L4D & L4D2] Dissolve Infected plugins.
    * The percussion sound is still active on a Gatling fire type machine gun, for the Cal 50 machine gun this does not happen.
    * The electric arcs of the Tesla type machine gun may disappear for a while, but it does not affect the machine gun.
    * Plugin only tested on Windows and SourceMod 1.10 on Left 4 Dead 1, SourceMod 1.11 Left 4 Dead 2.
    * If the plugin is restarted by admin and someone is using a machine gun created by this plugin, he will be stuck without being able to move.
    
    * - This Plugin is still under development so there could be some bug not mentioned before but in general it works without problems - *
    Changelog

    HTML Code:
    Version 4.0 [02-18-2021]
    - Public version.
    
    Version 4.1 [02-18-2021]
    - Added checkers for some missing events for valid entities and clients.
    
    Version 4.2 [02-21-2021]
    - New Cvar that allows to choose the time to drop an L4D1/2 machine gun and button use 
    checker only for L4D1
    (Full list of changes within the file)
    Installation

    1 - Click "Get Plugin" and put the "l4d_machine_gun_system.smx" file into your server or game \addons\sourcemod\plugins\ folder.
    2 - Click Get "l4d_machine_gun_system.phrases.txt" file and put in \addons\sourcemod\translations folder.
    3 - Only for a full effects display in Left 4 Dead 1. Download and install the Particle posted by Dragokas.
    (If you have any previous version please delete the file or move from plugins folder and cfg folder)
    Attached Files
    File Type: txt l4d_machine_gun_system.phrases.txt (7.4 KB, 254 views)
    File Type: sp Get Plugin or Get Source (l4d_machine_gun_system.sp - 395 views - 162.1 KB)
    __________________

    Last edited by Ernecio; 02-23-2021 at 15:05. Reason: New version.
    Ernecio is offline
    Farmoza
    Member
    Join Date: Dec 2016
    Old 02-18-2021 , 17:18   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #2

    The plugin is good already tested but there are errors in the logs
    L 02/19/2021 - 00:120: Info (map "c5m1_waterfront") (file "/game/left4dead2/addons/sourcemod/logs/errors_20210219.log")
    L 02/19/2021 - 00:120: [SM] Exception reported: Invalid edict (474 - 474)
    L 02/19/2021 - 00:120: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:120: [SM] Call stack trace:
    L 02/19/2021 - 00:120: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:120: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:120: [SM] Exception reported: Invalid edict (530 - 530)
    L 02/19/2021 - 00:120: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:120: [SM] Call stack trace:
    L 02/19/2021 - 00:120: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:120: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:120: [SM] Exception reported: Invalid edict (507 - 507)
    L 02/19/2021 - 00:120: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:120: [SM] Call stack trace:
    L 02/19/2021 - 00:120: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:120: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:13:23: [SM] Exception reported: Invalid edict (529 - 529)
    L 02/19/2021 - 00:13:23: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:13:23: [SM] Call stack trace:
    L 02/19/2021 - 00:13:23: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:13:23: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:16:12: [SM] Exception reported: Invalid edict (511 - 511)
    L 02/19/2021 - 00:16:12: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:16:12: [SM] Call stack trace:
    L 02/19/2021 - 00:16:12: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:16:12: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    Farmoza is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Brexit
    Old 02-18-2021 , 20:30   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #3

    Hey L4D_TE_Create_Particle is kinda old I made specialized tempentity particle stocks below.
    https://github.com/LuxLuma/Lux-Libra...brary.inc#L469
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Ernecio
    Member
    Join Date: Sep 2019
    Location: The United Mexican State
    Old 02-18-2021 , 23:17   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #4

    Quote:
    Originally Posted by Farmoza View Post
    The plugin is good already tested but there are errors in the logs
    L 02/19/2021 - 00:120: Info (map "c5m1_waterfront") (file "/game/left4dead2/addons/sourcemod/logs/errors_20210219.log")
    L 02/19/2021 - 00:120: [SM] Exception reported: Invalid edict (474 - 474)
    L 02/19/2021 - 00:120: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:120: [SM] Call stack trace:
    L 02/19/2021 - 00:120: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:120: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:120: [SM] Exception reported: Invalid edict (530 - 530)
    L 02/19/2021 - 00:120: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:120: [SM] Call stack trace:
    L 02/19/2021 - 00:120: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:120: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:120: [SM] Exception reported: Invalid edict (507 - 507)
    L 02/19/2021 - 00:120: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:120: [SM] Call stack trace:
    L 02/19/2021 - 00:120: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:120: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:13:23: [SM] Exception reported: Invalid edict (529 - 529)
    L 02/19/2021 - 00:13:23: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:13:23: [SM] Call stack trace:
    L 02/19/2021 - 00:13:23: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:13:23: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    L 02/19/2021 - 00:16:12: [SM] Exception reported: Invalid edict (511 - 511)
    L 02/19/2021 - 00:16:12: [SM] Blaming: l4d_machine_gun_system.smx
    L 02/19/2021 - 00:16:12: [SM] Call stack trace:
    L 02/19/2021 - 00:16:12: [SM] [0] GetEdictClassname
    L 02/19/2021 - 00:16:12: [SM] [1] Line 991, /home/groups/sourcemod/upload_tmp/phphGFJTv.sp::Event_PlayerUses
    Lol I didn't check this part of the code, but it's already fixed, thanks for reporting

    Quote:
    Originally Posted by Lux View Post
    Hey L4D_TE_Create_Particle is kinda old I made specialized tempentity particle stocks below.
    https://github.com/LuxLuma/Lux-Libra...brary.inc#L469
    Thanks for the update, I will try to use it in the future
    __________________

    Last edited by Ernecio; 02-19-2021 at 03:04.
    Ernecio is offline
    Mr. Man
    Veteran Member
    Join Date: Mar 2011
    Location: Huh?
    Old 02-19-2021 , 02:33   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #5

    Great to see continued development on a great idea - been running it on a test server with no issues so far. One question: can you shorten the machine gun placement time? I remember it used to be much shorter having to hold down E but your version takes significantly longer to place the gun down.
    __________________
    Mr. Man is offline
    Ernecio
    Member
    Join Date: Sep 2019
    Location: The United Mexican State
    Old 02-19-2021 , 03:14   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #6

    Quote:
    Originally Posted by Mr. Man View Post
    Great to see continued development on a great idea - been running it on a test server with no issues so far. One question: can you shorten the machine gun placement time? I remember it used to be much shorter having to hold down E but your version takes significantly longer to place the gun down.
    Some time ago i changed the time of placing the machine guns on the ground because i had some problems when using a button or helping a partner, But if you want i can change it and leave you a quick version.
    __________________
    Ernecio is offline
    Gold Fish
    Member
    Join Date: Mar 2020
    Old 02-19-2021 , 08:09   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #7

    Just wonderful!
    Gold Fish is offline
    Mr. Man
    Veteran Member
    Join Date: Mar 2011
    Location: Huh?
    Old 02-19-2021 , 10:31   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #8

    Quote:
    Originally Posted by Ernecio View Post
    Some time ago i changed the time of placing the machine guns on the ground because i had some problems when using a button or helping a partner, But if you want i can change it and leave you a quick version.
    Can we define the time using a cvar?
    __________________
    Mr. Man is offline
    Ernecio
    Member
    Join Date: Sep 2019
    Location: The United Mexican State
    Old 02-20-2021 , 23:29   Re: [L4D1 AND L4D2] Machine Gun System
    Reply With Quote #9

    Quote:
    Originally Posted by Mr. Man View Post
    Can we define the time using a cvar?
    Of course, I will put it in the next version, but first I will do some research to avoid errors when using a long time button in left 4 dead 1
    __________________
    Ernecio is offline
    ZBzibing
    Member
    Join Date: Dec 2012
    Old 02-25-2021 , 22:33   Re: [L4D1 AND L4D2] Machine Gun System(02/22/2021)
    Reply With Quote #10

    Can you learn from the witch guardian, hold down the E button to pick up or put it down, and even the progress bar prompts
    ZBzibing is offline
    Reply


    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 14:03.


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