Пользователь
- Сообщения
- 86
- Реакции
- 2
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.
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.
Код:
#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;
}