Raised This Month: $ Target: $400
 0% 

Smoke plugin bug


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 11:30.


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