Raised This Month: $ Target: $400
 0% 

Solved Remove smoke from HE Grenade (Black Smoke)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ChillerX
Member
Join Date: Dec 2022
Old 01-15-2023 , 15:23   Re: Remove smoke from HE Grenade
Reply With Quote #1

Quote:
Originally Posted by Th3822 View Post
with reapi it's easy, hook RG_CGrenade_ExplodeHeGrenade as Post, then delete the grenade (you may need to clear the pfnThink of the grenade, it's doable with set_ent_data)
I am still quite unexperienced with pawn, would you mind writing that code for me?

I am pretty sure this would be a helpful plugin that will slightly reduce fps drops in cs 1.6 csdm and similar DM servers. Especially for players with older pc`s which are actually the majority still playing it.

Thanks in advance.
ChillerX is offline
Th3822
Member
Join Date: Jan 2013
Location: Venezuela
Old 01-15-2023 , 15:25   Re: Remove smoke from HE Grenade
Reply With Quote #2

Quote:
Originally Posted by ChillerX View Post
I am still quite unexperienced with pawn, would you mind writing that code for me?

I am pretty sure this would be a helpful plugin that will slightly reduce fps drops in cs 1.6 csdm and similar DM servers. Especially for players with older pc`s which are actually the majority still playing it.

Thanks in advance.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <reapi>

public plugin_init()
{
    
register_plugin("No HE Smoke""0.1""Th3-822");
    
RegisterHookChain(RG_CGrenade_ExplodeHeGrenade"HE_Exploded"1);
}

public 
HE_Exploded(iEnt)
{
    
// Remove "smoke & remove" think
    
set_ent_data(iEnt"CBaseEntity""m_pfnThink"0);
    
// Remove grenade (yes, there are "better" methods to do this, but i'm lazy to add more lines)
    
engfunc(EngFunc_RemoveEntityiEnt);

Th3822 is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 01-15-2023 , 20:40   Re: Remove smoke from HE Grenade
Reply With Quote #3

Quote:
Originally Posted by Th3822 View Post
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <reapi>

public plugin_init()
{
    
register_plugin("No HE Smoke""0.1""Th3-822");
    
RegisterHookChain(RG_CGrenade_ExplodeHeGrenade"HE_Exploded"1);
}

public 
HE_Exploded(iEnt)
{
    
// Remove "smoke & remove" think
    
set_ent_data(iEnt"CBaseEntity""m_pfnThink"0);
    
// Remove grenade (yes, there are "better" methods to do this, but i'm lazy to add more lines)
    
engfunc(EngFunc_RemoveEntityiEnt);

This is actually sort of a really good thought process, I would have never thought of doing it this way lol.
I would have just unprecached black_smoke1,2,3,4.spr, but idk if its also used in clientside.
__________________
deprale is offline
Th3822
Member
Join Date: Jan 2013
Location: Venezuela
Old 01-15-2023 , 20:43   Re: Remove smoke from HE Grenade
Reply With Quote #4

Quote:
Originally Posted by deprale View Post
This is actually sort of a really good thought process, I would have never thought of doing it this way lol.
I would have just unprecached black_smoke1,2,3,4.spr, but idk if its also used in clientside.
just did a quick search on regamedll for the grenade and the explosion (regame has hooks for almost everything, but those are kinda new, they weren't in my old .inc) and found that the smoke was added totally after the explosion function and it was hookable
Th3822 is offline
Reply



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 20:04.


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