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

Special Effects In CS:S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Soloist
Senior Member
Join Date: Jun 2004
Location: New York
Old 07-30-2008 , 15:57   Special Effects In CS:S
Reply With Quote #1

With AMXModX there were functions like this:
Code:
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
message_begin(MSG_ALL, get_user_msgclient("ScoreInfo"));
message_begin(MSG_ALL, get_user_msgclient("DeathMsg"));
message_begin(MSG_ONE, get_user_msgclient("Damage"), {0, 0, 0}, victim);
message_end();
What are these functions in Sourcemod?
Soloist is offline
Send a message via ICQ to Soloist Send a message via AIM to Soloist Send a message via MSN to Soloist Send a message via Yahoo to Soloist
Aviram1994
Member
Join Date: Jan 2007
Old 07-30-2008 , 21:51   Re: Special Effects In CS:S
Reply With Quote #2

WriteInt
WriteVector
It's just Write[DataType] like
WriteFloat
Code that was using that:
Code:
TE_Particle(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,
            Float:delay=0.0)
{
    // find string table
    new tblidx = FindStringTable("ParticleEffectNames");
    if (tblidx==INVALID_STRING_TABLE) 
    {
        LogError("Could not find string table: ParticleEffectNames");
        return;
    }
    
    // find particle index
    new String:tmp[256];
    new count = GetStringTableNumStrings(tblidx);
    new stridx = INVALID_STRING_INDEX;
    new i;
    for (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;
    }
    
    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);    
    TE_SendToAll(delay);
}
Aviram1994 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 05:32.


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