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

Smoke plugin bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abecee
Junior Member
Join Date: Feb 2022
Old 08-17-2023 , 16:34   Smoke plugin bug
Reply With Quote #1

Hi.

I found this plugin on the net, it's functional and what I'm looking for, just that sometimes some people have their smoke disappear and I don't understand why ( it happens randomly without that person doing anything, just playing ).
Could someone help me with fixing this bug if possible?

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


public plugin_init() {
    register_plugin("Smoke Thickness", "1.0", "JuSTaR");

    register_cvar("smoke_thickness","3");

    register_forward(FM_PlaybackEvent, "smokeEvent");

}


public smokeEvent(flags, id, eventid, Float:delay, Float:Origin[3], Float:Angles[3], Float:fparam1, Float:fparam2, iparam1, iparam2,bparam1, bparam2)
{
    if((eventid == 26) && (fparam1 == 0.0) && (fparam2 == 0.0) && (iparam2 == 1))
    {
        new smokeEnt = find_ent_by_class(-1,"grenade");

        while(smokeEnt)
        {
            new model[32];
            entity_get_string(smokeEnt, EV_SZ_model, model, 31);


            if(equal(model, "models/w_smokegrenade.mdl"))
            {
                new Float:smoke_origin[3];
                entity_get_vector (smokeEnt, EV_VEC_origin, smoke_origin);

                if((smoke_origin[0] == Origin[0]) && (smoke_origin[0] == Origin[0]) && (smoke_origin[0] == Origin[0]))
                {
                    new Float:angle[3];
                    angle[0] = 0.0;
                    angle[1] = 0.0;
                    angle[2] = 0.0;

                    for (new i = 0; i < get_cvar_num("smoke_thickness"); i++)
                        playback_event(0, smokeEnt, 26, 0.0 , smoke_origin, angle, 0.0, 0.0, 0, 1, 0, 0);
                }
            }

            smokeEnt = find_ent_by_class(smokeEnt,"grenade");
        }
    }

    return FMRES_IGNORED;
}
abecee is offline
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 08-19-2023 , 05:21   Re: Smoke plugin bug
Reply With Quote #2

I am sure you are running a non-steam server, please post us your meta list and version outputs
__________________
I ONLY LOVE STEAM, NON-STEAM IS VERY BAD FOR YOUR HEALTH!
Kowalsky is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 08-19-2023 , 16:23   Re: Smoke plugin bug
Reply With Quote #3

Quote:
Originally Posted by Kowalsky View Post
I am sure you are running a non-steam server, please post us your meta list and version outputs
what relationship does it have
__________________
mlibre is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 08-23-2023 , 20:03   Re: Smoke plugin bug
Reply With Quote #4

I may be wrong, but AFAIK the game client can render up to 512 sprites at the same time.
This plugin increases the smoke density by adding additional smokes to the game scene,
therefore when there are multiple smokes on the map, some of them won't be rendered.
Try to decrease smoke density by changing smoke_thickness cvar, say to 2 (now you have 3).
It should help.

Last edited by damage220; 09-18-2023 at 11:45. Reason: typo
damage220 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:13.


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