AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   HL2DM - Grenade Trails (https://forums.alliedmods.net/showthread.php?t=325858)

belgvr 07-09-2020 05:25

HL2DM - Grenade Trails
 
1 Attachment(s)
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.

http://oppressiveterritory.ddns.net/...nadetrails.jpg

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

http://oppressiveterritory.ddns.net/trollnade.jpeg

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"


daren adler 12-01-2020 11:59

Re: HL2DM - Grenade Trails
 
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.

belgvr 12-01-2020 18:30

Re: HL2DM - Grenade Trails
 
Quote:

Originally Posted by daren adler (Post 2726946)
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. =)

Peter Brev 04-28-2024 12:36

Re: HL2DM - Grenade Trails
 
1 Attachment(s)
Here, that should solve that error.


All times are GMT -4. The time now is 00:48.

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