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-15-2016 14:33

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

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.
I don't think that is necessary. It would be obvious if a file is missing. A message will show in the console if a sound is missing, and the server will automatically crash if the sprite is missing. In addition, file_exists checks in the cstrike folder, and people may use sounds from the valve folder.

Quote:

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.
I did it for the sound, but I'm not replacing any sprites.

Quote:

In grenade_throw check if user is alive before retrieving team.
Are you sure about this? What if the player dies in the exact moment when he is about to throw the grenade? What's the problem of getting the team of a dead player?

Everything else is fixed.

OciXCrom 05-20-2016 20:23

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
 
Any updates about approval soon? Let me know if you have any suggestions.

HamletEagle 07-10-2016 13:50

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

I don't think that is necessary. It would be obvious if a file is missing. A message will show in the console if a sound is missing, and the server will automatically crash if the sprite is missing. In addition, file_exists checks in the cstrike folder, and people may use sounds from the valve folder.
There are ways to check valve folder too, IIRC by doing ../valve(in 1.8.3 a param was added for this), and the point was to avoid the crash and simply notice the owner that something in his configuration is wrong. Well, not really critical, just an ideea.

1.static in msgTextMsg, msgSendAudio is not needed.
2.
PHP Code:

return equal(szMessageg_szFireInTheHole) ? PLUGIN_HANDLED PLUGIN_CONTINUE 

? PLUGIN_HANDLED : PLUGIN_CONTINUE is not needed, simply return what equal give.
3.In fwdSetModel: default: return. Given the condition this can't ever by reached, can be removed.
4.
Quote:

Are you sure about this? What if the player dies in the exact moment when he is about to throw the grenade? What's the problem of getting the team of a dead player?
CSX fires grenade_throw forward from SetModel post, so after grenade is actually throw(SetModel being called at the end of the function which creates a grenade). Probably connected check is more proper than alive.
5.In grenade_throw:
  • Check if contain() != -1.
  • PHP Code:

    get_players(iPlayersiPnum

    skip bots, they don't need such information.
  • if(!is_blank(szSound)) is pointless, forward is called only for grenades so code reach a case for sure and string can't be empty.
6.In fwdPrecacheSound check if you should replace the sound before blocking the original one.
7.
PHP Code:

return szString[0] == EOS true false 

? true : false is not needed. Same for is_random
8.When reading the file, if it was empty, so plugin should not do anything pause it.

OciXCrom 07-11-2016 08:07

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

if(!is_blank(szSound)) is pointless, forward is called only for grenades so code reach a case for sure and string can't be empty.
It actually can be empty if you enable the sounds from the .ini file and leave a line empty for a certain grenade, which will block the "fire in the hole" sound for that grenade.

Quote:

In fwdPrecacheSound check if you should replace the sound before blocking the original one.
There's a check for that when registering the forward in plugin_init, so it won't be called unless the sound should be blocked.

PHP Code:

if(g_eSettings[stgSoundEnable] && ((!g_blSoundHe && !g_blSoundFlash && !g_blSoundSmoke) || !g_eSettings[stgSoundPlayType]))
        
register_forward(FM_PrecacheSound"fwdPrecacheSound"

Everything else is fixed.

HamletEagle 07-11-2016 10:05

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
 
Glad to see you follow me, sometime I get bored when making reviews and I don't pay much attention.

Quote:

It actually can be empty if you enable the sounds from the .ini file and leave a line empty for a certain grenade, which will block the "fire in the hole" sound for that grenade.
PHP Code:

if(is_blank(szValue))
    continue 

You are checking if szValue is empty.

OciXCrom 07-11-2016 13:52

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
 
No, no. Let's say for example the user wants to block the "fire in the hole" sound for the HE grenade. He will leave the option SOUND_HE blank in the .ini file, so g_eSettings[stgSoundHe] will be empty, since no value is passed to it with or without the is_blank(szValue) check in fileRead(). Next, when grenade_throw() is called, the sound of the thrown grenade gets coppied into szSound, so if a HE grenade was thrown, szSound will be empty and if it was some other grenade - it won't be empty, so that's why that check is there - if it wasn't, the plugin will atempt to play a blank sound on the player(s).

Are you following? :D

MaXs 01-24-2017 10:31

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
 
so useful plugin.. bad

OciXCrom 01-24-2017 10:32

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

Originally Posted by MaXs (Post 2489482)
so useful plugin.. bad

I'm glad that you find it useful. Thanks. :crab:

MaXs 01-24-2017 10:48

Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
 
make better ones, not bad ones

OciXCrom 01-24-2017 13:09

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

Originally Posted by MaXs (Post 2489491)
make better ones, not bad ones

Let me see you do something useful.


All times are GMT -4. The time now is 07:01.

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