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

HL2DM - Grenade Trails


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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:
    5 
    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 - 799 views - 7.8 KB)

    Last edited by belgvr; 07-10-2020 at 14:28.
    belgvr is offline
     



    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:10.


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