AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND (https://forums.alliedmods.net/showthread.php?t=309478)

CrazY. 07-27-2018 17:13

[ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Hello, is there any way to create a explosion through env_explosion entity but pass the TE_EXPLFLAG_NOSOUND? I tried to set SF_ENVEXPLOSION_NOFIREBALL but this won't will work because env_explosion will still call TE_EXPLOSION message with TE_EXPLFLAG_NONE.

Code:

void CEnvExplosion::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
        TraceResult tr;

        pev->model = iStringNull;// invisible
        pev->solid = SOLID_NOT;// intangible

        Vector vecSpot;// trace starts here!

        vecSpot = pev->origin + Vector(0, 0, 8);

        UTIL_TraceLine(vecSpot, vecSpot + Vector(0, 0, -40), ignore_monsters, ENT(pev), &tr);

        // Pull out of the wall a bit
        if (tr.flFraction != 1.0f)
        {
                pev->origin = tr.vecEndPos + (tr.vecPlaneNormal * (m_iMagnitude - 24) * 0.6f);
        }

        // draw decal
        if (!(pev->spawnflags & SF_ENVEXPLOSION_NODECAL))
        {
                if (RANDOM_FLOAT(0, 1) < 0.5f)
                {
                        UTIL_DecalTrace(&tr, DECAL_SCORCH1);
                }
                else
                {
                        UTIL_DecalTrace(&tr, DECAL_SCORCH2);
                }
        }

        // draw fireball
        if (!(pev->spawnflags & SF_ENVEXPLOSION_NOFIREBALL))
        {
                MESSAGE_BEGIN(MSG_PAS, SVC_TEMPENTITY, pev->origin);
                        WRITE_BYTE(TE_EXPLOSION);
                        WRITE_COORD(pev->origin.x);
                        WRITE_COORD(pev->origin.y);
                        WRITE_COORD(pev->origin.z);
                        WRITE_SHORT(g_sModelIndexFireball);
                        WRITE_BYTE(byte(m_spriteScale)); // scale * 10
                        WRITE_BYTE(15); // framerate
                        WRITE_BYTE(TE_EXPLFLAG_NONE);
                MESSAGE_END();
        }
        else
        {
                MESSAGE_BEGIN(MSG_PAS, SVC_TEMPENTITY, pev->origin);
                        WRITE_BYTE(TE_EXPLOSION);
                        WRITE_COORD(pev->origin.x);
                        WRITE_COORD(pev->origin.y);
                        WRITE_COORD(pev->origin.z);
                        WRITE_SHORT(g_sModelIndexFireball);
                        WRITE_BYTE(0); // no sprite
                        WRITE_BYTE(15); // framerate
                        WRITE_BYTE(TE_EXPLFLAG_NONE);
                MESSAGE_END();
        }

        // do damage
        if (!(pev->spawnflags & SF_ENVEXPLOSION_NODAMAGE))
        {
                RadiusDamage(pev, pev, m_iMagnitude, CLASS_NONE, DMG_BLAST);
        }

        SetThink(&CEnvExplosion::Smoke);
        pev->nextthink = gpGlobals->time + 0.3f;

        // draw sparks
        if (!(pev->spawnflags & SF_ENVEXPLOSION_NOSPARKS))
        {
                int sparkCount = RANDOM_LONG(0, 3);
                for (int i = 0; i < sparkCount; i++)
                {
                        Create("spark_shower", pev->origin, tr.vecPlaneNormal, nullptr);
                }
        }
}


thEsp 07-31-2018 12:14

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
We all work for money
And youre just an mere idiot
REMEMBER ?

HamletEagle 07-31-2018 12:37

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Hook the message and alter that param.

Ghosted 07-31-2018 12:43

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Quote:

Originally Posted by thEsp (Post 2607292)
We all work for money
And youre just an mere idiot
REMEMBER ?

:crab: wtf :crab:

NiHiLaNTh 07-31-2018 12:51

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Sounds like XY problem.

thEsp 07-31-2018 13:47

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Quote:

Originally Posted by Ghosted (Post 2607301)
:crab: wtf :crab:

This boi seems to work for money, he sells plugins and doesn't publish them, while he gets help/information in this forum...
Should someone like him be banned ? :|

Ghosted 07-31-2018 14:25

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Quote:

Originally Posted by thEsp (Post 2607324)
This boi seems to work for money, he sells plugins and doesn't publish them, while he gets help/information in this forum...
Should someone like him be banned ? :|

no, helpers must get 40% of the payment :)

thEsp 07-31-2018 14:59

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Quote:

Originally Posted by Ghosted (Post 2607331)
no, helpers must get 40% of the payment :)

That would be awesome ,but he's just an economic :3

Natsheh 07-31-2018 16:50

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
Quote:

Originally Posted by thEsp (Post 2607343)
That would be awesome ,but he's just an economic :3

Nothing wrong with being economic!

CrazY. 08-02-2018 09:40

Re: [ H3LP ] env_explosion TE_EXPLFLAG_NOSOUND
 
The better way I've found was remake entire code of explode.cpp.

@thEsp, I don't see any problem in sell plugins, you're mad because you want all for free, but is not that way the life works. Instead of lose time posting bullshits, learn how to code with amxx and make plugins with yourself. The forum was made to ask, learn and help other developers, but each one can do what he want with what he've learned. The same way is with me, if I sell or not my plugins, the problem is not yours nor of any one that helped me.


All times are GMT -4. The time now is 03:59.

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