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

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


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-15-2016 , 14:33   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #11

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 is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-20-2016 , 20:23   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #12

Any updates about approval soon? Let me know if you have any suggestions.

Last edited by OciXCrom; 05-20-2016 at 20:24.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-10-2016 , 13:50   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #13

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.
__________________

Last edited by HamletEagle; 07-10-2016 at 13:52.
HamletEagle is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-11-2016 , 08:07   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #14

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.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-11-2016 , 10:05   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #15

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.
__________________

Last edited by HamletEagle; 07-11-2016 at 10:06.
HamletEagle is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-11-2016 , 13:52   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #16

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?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MaXs
Member
Join Date: Jan 2017
Old 01-24-2017 , 10:31   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #17

so useful plugin.. bad
MaXs is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-24-2017 , 10:32   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #18

Quote:
Originally Posted by MaXs View Post
so useful plugin.. bad
I'm glad that you find it useful. Thanks.
__________________

Last edited by OciXCrom; 01-24-2017 at 10:32.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MaXs
Member
Join Date: Jan 2017
Old 01-24-2017 , 10:48   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #19

make better ones, not bad ones
MaXs is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-24-2017 , 13:09   Re: Ultimate Fire in the Hole [Messages|Grenade Trail|Grenade Glow|Sounds]
Reply With Quote #20

Quote:
Originally Posted by MaXs View Post
make better ones, not bad ones
Let me see you do something useful.
__________________

Last edited by OciXCrom; 01-24-2017 at 13:11.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

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 12:18.


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