NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Hello. I have created a plugin which changes default aura model to custom one. Then, some pro told me that it lags for a milisecond when you turn on the turbo/swoop. I didn't believe him at first because I haven't noticed anything strange with the aura.
Then, after losing 1 vs. 1 against him 10-1 (I've left him 9 HP) he told me that I might not notice the short lag, but he does. He plays ESF from the very beginning (at least he said so) and that's why he does notice the short lag.
This is the code I'm using:
So, can this result in a like 0.05 (more or less) sec lag? If so, can I optimize the code somehow?
EDIT: That pro is pharaoh.
Then, after losing 1 vs. 1 against him 10-1 (I've left him 9 HP) he told me that I might not notice the short lag, but he does. He plays ESF from the very beginning (at least he said so) and that's why he does notice the short lag.
This is the code I'm using:
Code:
#include <amxmodx>
#include <fakemeta>
new CustomAuraModel[] = "models/newaura.mdl";
public plugin_precache()
engfunc(EngFunc_PrecacheModel, CustomAuraModel);
public plugin_init()
{
register_plugin("Custom Aura Model", "1.0", "hleV");
register_forward(FM_EmitSound, "EmitSoundForward");
}
public EmitSoundForward(ClientID, ChannelID, SoundName[])
{
if (contain(SoundName, "swoop") != -1 || contain(SoundName, "aura") != -1) // Maybe I should use equal()
{
static EntityID;
EntityID = FM_NULLENT;
while ((EntityID = engfunc(EngFunc_FindEntityByString, EntityID, "model", "models/aura.mdl")) > 0)
if (pev(EntityID, pev_owner) == ClientID)
{
engfunc(EngFunc_SetModel, EntityID, CustomAuraModel);
break; // Not sure if it's needed here
}
}
}
EDIT: That pro is pharaoh.
Last edited: