View Single Post
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 07-18-2013 , 00:28   Re: [TF2] Gift Mod [1.2.3] - [7/13/2013] - Fixes TF2 Update crash
Reply With Quote #132

If you're not using a tempent, try doing so for the particle stuff.
Code:
stock bool:TE_SetupTFParticle(String:Name[],
            Float:origin[3] = NULL_VECTOR,
            Float:start[3] = NULL_VECTOR,
            Float:angles[3] = NULL_VECTOR,
            entindex = -1,
            attachtype = -1,
            attachpoint = -1,
            bool:resetParticles = true)
{
    // find string table
    new tblidx = FindStringTable("ParticleEffectNames");
    if (tblidx == INVALID_STRING_TABLE)
    {
        LogError("Could not find string table: ParticleEffectNames");
        return false;
    }
    // find particle index
    new String:tmp[256];
    new count = GetStringTableNumStrings(tblidx);
    new stridx = INVALID_STRING_INDEX;
    for (new i = 0; i < count; i++)
    {
        ReadStringTable(tblidx, i, tmp, sizeof(tmp));
        if (StrEqual(tmp, Name, false))
        {
            stridx = i;
            break;
        }
    }
    if (stridx == INVALID_STRING_INDEX)
    {
        LogError("Could not find particle: %s", Name);
        return false;
    }

    TE_Start("TFParticleEffect");
    TE_WriteFloat("m_vecOrigin[0]", origin[0]);
    TE_WriteFloat("m_vecOrigin[1]", origin[1]);
    TE_WriteFloat("m_vecOrigin[2]", origin[2]);
    TE_WriteFloat("m_vecStart[0]", start[0]);
    TE_WriteFloat("m_vecStart[1]", start[1]);
    TE_WriteFloat("m_vecStart[2]", start[2]);
    TE_WriteVector("m_vecAngles", angles);
    TE_WriteNum("m_iParticleSystemIndex", stridx);
    if (entindex != -1)
    {
        TE_WriteNum("entindex", entindex);
    }
    if (attachtype != -1)
    {
        TE_WriteNum("m_iAttachType", attachtype);
    }
    if (attachpoint != -1)
    {
        TE_WriteNum("m_iAttachmentPointIndex", attachpoint);
    }
    TE_WriteNum("m_bResetParticles", resetParticles ? 1 : 0);
    return true;
}
I... don't remember quite how to use it, but you'll get it eventually.
I've got it for something like this:
Code:
    if (TE_SetupTFParticle(effectname, pos, _, _, prop, 3, 0, false))
        TE_SendToAll(0.0);
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline