Raised This Month: $12 Target: $400
 3% 

HL2DM - Grenade Trails


Post New Thread Reply   
 
Thread Tools Display Modes
Author
belgvr
Member
Join Date: Dec 2008
Location: Brazil
Plugin ID:
7195
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Half-Life 2 Deathmatch
Plugin Dependencies:
    Servers with this Plugin:
    9 
    Plugin Description:
    Makes grenades have cool trails.
    Old 07-09-2020 , 05:25   HL2DM - Grenade Trails
    Reply With Quote #1

    This is my first plugin. I will start by confessing i'm a total n00b at coding, so... this is just a modification of scorp's crossbow trail plugin (inspired on Trailball by raziEil) that he was kind enough to develop for me some months ago.

    This plugin attaches trails to grenades giving it a cool visual effect.

    What I did was to just change the entity to attach trails to, which is the npc_grenade_frag.
    I also added a ConVar named sm_grenadetrail_material to allow you to change the material of the trail instantly. The only advice is to pay attention to spelling or if your texture exists in your materials folder because invalid textures can cause clients to crash when they throw a grenade.



    It can even supports custom materials as long as you have a plugin to force clients to download and precache, i would recommend SWAT_88's great plugin for this. More info HERE



    To install:, copy sm_grenadetrails.smx to sourcemod/plugins folder

    After installing the plugin and loading it for the first time, it will generate a config file in cfg/sourcemod named sm_grenadetrail.cfg

    Note: I am also looking for a way to remove the original npc_grenade_frag red trail. Suggestions are welcome! =)

    Support me? *-*
    paypal: [email protected]


    sm_grenadetrail.cfg:
    Code:
    // The default Combine team trail color (Team deathmatch). Three values between 0-255 separated by spaces. RGB - Red Green Blue.
    // -
    // Default: "91 244 191"
    sm_grenadetrail_combine_color "91 244 191"
    
    // Enable Trail
    // -
    // Default: "1"
    sm_grenadetrail_enabled "1"
    
    // The width of the beam when it has full expanded. Note: if 'sm_grenadetrail_random_width' = 1 the random value of end width will be between 1 and this convar.
    // -
    // Default: "5.0"
    sm_grenadetrail_end_width "5.0"
    
    // How long the trail is shown ('tail' length).
    // -
    // Default: "2.0"
    sm_grenadetrail_life_time "2.0"
    
    // Trail Material. CAUTION: invalid material may cause clients to crash!!
    // -
    // Default: "sprites/smoke.vmt"
    sm_grenadetrail_material "sprites/smoke.vmt"
    
    // Use Beam Follow Render Method Instead Of 'env_spritetrail' Entity
    // -
    // Default: "1"
    sm_grenadetrail_new_render_method "1"
    
    // 0=Disable, 1=Enable random trail colors.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_grenadetrail_random_color "1"
    
    // 0=Disable, 1=Enable random width
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_grenadetrail_random_width "0"
    
    // The default Rebels team trail color (Team deathmatch). Three values between 0-255 separated by spaces. RGB - Red Green Blue.
    // -
    // Default: "198 87 0"
    sm_grenadetrail_rebels_color "198 87 0"
    
    // The width of the beam to the beginning. Note: if 'sm_grenadetrail_random_width' = 1 the random value of start width will be between 1 and this convar.
    // -
    // Default: "2.0"
    sm_grenadetrail_start_width "2.0"
    
    // The default trail color. Three values between 0-255 separated by spaces. RGB - Red Green Blue.
    // -
    // Default: "255 0 0"
    sm_grenadetrail_static_color "255 0 0"
    
    // Forced to use Team deathmatch colors.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    sm_grenadetrail_tdm_color "0"
    Attached Files
    File Type: sp Get Plugin or Get Source (sm_grenadetrail.sp - 747 views - 7.8 KB)

    Last edited by belgvr; 07-10-2020 at 14:28.
    belgvr is offline
    daren adler
    Member
    Join Date: Aug 2017
    Location: Iowa
    Old 12-01-2020 , 11:59   Re: HL2DM - Grenade Trails
    Reply With Quote #2

    I get this using your plugin

    /01/2020 - 09:55:53: [SM] Exception reported: Client index -1 is invalid
    L 12/01/2020 - 09:55:53: [SM] Blaming: sm_grenadetrail.smx
    L 12/01/2020 - 09:55:53: [SM] Call stack trace:
    L 12/01/2020 - 09:55:53: [SM] [0] IsClientInGame
    L 12/01/2020 - 09:55:53: [SM] [1] Line 123, /home/groups/sourcemod/upload_tmp/php66tB7V.sp::CreateSpriteTrail
    L 12/01/2020 - 09:55:53: [SM] [2] Line 117, /home/groups/sourcemod/upload_tmp/php66tB7V.sp::On_npc_grenade_frag_EntityCreat edNextFrame

    please help.
    __________________
    GuitarSlayer
    daren adler is offline
    Send a message via MSN to daren adler
    belgvr
    Member
    Join Date: Dec 2008
    Location: Brazil
    Old 12-01-2020 , 18:30   Re: HL2DM - Grenade Trails
    Reply With Quote #3

    Quote:
    Originally Posted by daren adler View Post
    I get this using your plugin

    /01/2020 - 09:55:53: [SM] Exception reported: Client index -1 is invalid
    L 12/01/2020 - 09:55:53: [SM] Blaming: sm_grenadetrail.smx
    L 12/01/2020 - 09:55:53: [SM] Call stack trace:
    L 12/01/2020 - 09:55:53: [SM] [0] IsClientInGame
    L 12/01/2020 - 09:55:53: [SM] [1] Line 123, /home/groups/sourcemod/upload_tmp/php66tB7V.sp::CreateSpriteTrail
    L 12/01/2020 - 09:55:53: [SM] [2] Line 117, /home/groups/sourcemod/upload_tmp/php66tB7V.sp::On_npc_grenade_frag_EntityCreat edNextFrame

    please help.
    Thanks for letting me know!
    Actually i get this error too when using the scorp's crossbow trail plugin that he made for me.
    Since this plugin is a "mod" from his and i am a total noob at coding, I don't really know how to solve this issue yet and I will post an update as soon as i get this fixe.
    For now, any help will be much appreciated. =)

    Last edited by belgvr; 12-01-2020 at 18:31.
    belgvr 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 07:38.


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