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"