AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds] (https://forums.alliedmods.net/showthread.php?t=282686)

OciXCrom 05-14-2016 16:08

Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
 
3 Attachment(s)

Description
  • This plugin allows you to change the messages which show up when you throw a grenade (fire in the hole), to add custom trail with different colors, as well as different sounds for every grenade there is or completely block them.

Images

http://i.imgur.com/Iw0oG1i.jpg

http://i.imgur.com/y40w0KW.jpg
http://i.imgur.com/5KQiZfv.jpg
http://i.imgur.com/fSVxmon.jpg
http://i.imgur.com/ZhHTvtf.jpg
http://i.imgur.com/WSwbRZw.jpg
http://i.imgur.com/fKW9zOm.jpg
http://i.imgur.com/X1kzaGd.jpg

Settings
  • The settings can be changed from the file configs/FireInTheHole.ini:

    [Messages = 1] - In this section you can find and modify the grenade messages. Set it to "0" if you want to disable them and use the default ones.
    • MSG_HE: The message when you throw a HE grenade.
    • MSG_FLASH: The message when you throw a Flash grenade.
    • MSG_SMOKE: The message when you throw a Smoke grenade.
    • MSG_SHOW_TYPE: Which players should be able to see the messages?
      • "0" = disable messages completely.
      • "1" = only the player who threw the grenade.
      • "2" = only teammates.
      • "3" = all players.
    • MSG_ADMIN_LISTEN: Whether admins should see other team's messages if MSG_SHOW_TYPE = 2.
    • MSG_ADMIN_FLAG: The admin flag for the setting above.
    • MSG_TEAM_T: Used when %team% is applied.
    • MSG_TEAM_CT: Used when %team% is applied.
    • MSG_TEAM_SPEC: Used when %team% is applied.

    [Sounds = 0] - Change it to "1" if you want to enable custom sounds when you throw a grenade. You can leave a field blank if you want that grenade to be without a sounds. Leave them all blank if you want to completely block the "fire in the hole" sound.
    • SOUND_HE: The sound when you throw a HE grenade.
    • SOUND_FLASH: The sound when you throw a Flash grenade.
    • SOUND_SMOKE: The sound when you throw a Smoke grenade.
    • SOUND_PLAY_TYPE: Who should hear the sound?
      • "0" = nobody, disables sounds completely.
      • "1" = only the player who threw the grenade.
      • "2" = only teammates.
      • "3" = all players.


    [Trail = 1] - Here you can moidfy the grenades' trail. Set it to "0" if you want to disable it. Use "R" if you want the given value of the color to be random (Example: 255 R 150 or R R R).
    • TRAIL_HE: The trail when you throw a HE grenade.
    • TRAIL_FLASH: The trail when you throw a Flash grenade.
    • TRAIL_SMOKE: The trail when you throw a Smoke grenade.
    • TRAIL_SPRITE: The sprite for the trail.
    • TRAIL_LIFE: Trail duration.
    • TRAIL_WIDTH: Trail width.
    • TRAIL_BRIGHTNESS: Trail brightness.
    • TRAIL_SHOW_TYPE: Who can see the trail?
      • "0" = everybody.
      • "1" = only the player who threw the grenade.
      • "2" = only teammates.

    [Glow = 1] - This section allows you to make grenades glow after they are thrown in the air. Use "R" if you want the given value of the color to be random (Example: 255 R 150 or R R R).
    • GLOW_HE: Glow for HE Grenade.
    • GLOW_FLASH: Glow for Flash Grenade.
    • GLOW_SMOKE: Glow for Smoke Grenade.
    • GLOW_BRIGHTNESS: Glow brightness.
    • GLOW_TYPE: Glow type ("0" = don't apply invisibility to the grenade).

    [Explode = 0] - Here you can change the time it takes for a grenade to explode after it has been thrown.
    • EXPLODE_HE: Explosion time for HE Grenade.
    • EXPLODE_FLASH: Explosion time for Flash Grenade.
    • EXPLODE_SMOKE: Explosion time for Smoke Grenade.

https://raw.githubusercontent.com/Oc...using_this.png
https://raw.githubusercontent.com/Oc...plugin_lab.png
https://raw.githubusercontent.com/Oc...ad_default.png

ComedyShotsGamer 05-14-2016 17:20

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
Nice Plugin good Idea!

EFFx 05-14-2016 19:26

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
whats the difference between others plugins? .ini file?

Bugsy 05-14-2016 20:09

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
This one also exists: https://forums.alliedmods.net/showthread.php?p=401813

But yours has more configuration\customization.

EFFx 05-14-2016 21:15

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
Exactly!

OciXCrom 05-15-2016 08:17

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
Quote:

Originally Posted by EFFx (Post 2419067)
Exactly!

Exactly as well. It has many things you can customize and it's far more easier to make changes to it in comparison with the other one(s). I know there's already a plugin for grenade messages and another one for grenade trail, but I think that these things should be combined together and made easy to modify. The downside of "Descriptive Fire in the Hole" is that it has got no cvars/cfg file at all and users need to modify the .sma file in order to make changes. In comparison with "Grenade Trail", this one allows you to modify the sprite, width, duration and brightness, as well as set a random color for each grenade/color value, instead of doing it for all of them at once. I also included an option to add a different "fire in the hole" sound for each grenade, which I wasn't able to find in any other plugin. It also enables you to block the sound completely, which is another highly requested modification. I would probably add even more options to this one, since I named it "ultimate", so let me know if you have any suggestions.

GordonFreeman (RU) 05-15-2016 08:50

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
gj

siriusmd99 05-15-2016 09:28

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
This could be approved ,it has sounds, trail colorchat messages to customize. It's very useful for many servers...

OciXCrom 05-15-2016 10:26

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
I'm glad that you like it. I added more options to it:

  • Added a glow section, from where you can activate grenade glow on thrown grenades.
  • You can customize the glow for every grenade, as well as make it random.
  • You can even make the grenades look like this - http://i.imgur.com/fKW9zOm.jpg
  • Added an option to configure which players can see the grenade messages: nobody, only the player who threw the grenade, only teammates, or all players.
  • You can make admins with a specified flags use "admin listen" to see other team's grenade messages.
  • You can now use %team% in the messages to show the player's team (the team names are also customizable).
  • Added an option to configure which players can hear the sounds: nobody, only the player who threw the grenade, only teammates, or all players.
  • Fixed a small but annoying mistake - all players could see everyones' messages/sounds.

HamletEagle 05-15-2016 12:05

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Sounds]
 
Yeah, that's something with more functionalities, so I'm okay with it.

As per usual, firstly what I saw at a quick glance:
  • In fileRead:
    • strlen(szData) should be cached.
    • You should add some checks for data validity inside configuration file. Like, when you get the color for message, it can be from 3 to 6, everything that is outside this is invalid. For this, use clamp:
      PHP Code:

      clamp(str_to_num(szValue), 36

      How this works? Anything lower than 3 is converted to 3, everything bigger than 6 becomes 6, so you don't get invalid input. If between 3 and 6, value does not change. Apply such kind of checks on any kind of value, when it makes sense.
    • You should also check if your szValue contains something and it's not empty:
      PHP Code:

      if(is_blank(szValue))
      {
           continue 


      Should be before if(g_eSettings[stgMsgEnable]).
    • Checking if sound/sprite exists before passing it to precache would be nice. Use file_exists for that.
    • In case of wrong configuration, make some logs to notify the user.
  • When replacing the old sounds/sprites you could unprecache the new ones(just a matter to hook FM_PrecacheModel for sprites and check the sprite name, for sounds hook FM_PrecacheSound). I assume you know default names for sounds & sprites.
  • In fwdSetModel, check if entity is valid before doing anything.
  • In grenade_throw check if user is alive before retrieving team.


All times are GMT -4. The time now is 13:35.

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