Raised This Month: $32 Target: $400
 8% 

Little explanation about entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 11-24-2011 , 10:57   Little explanation about entities
Reply With Quote #1

Hi there,

so i'm editing Naris and L.Duke Tripmines plugin, to make Freeze mines. I need a little explanation about this code. If i get it right, each tripmine entity is added to array. For example: g_SavedEntityRef[c], and then it is used to watch, who passed the beam, to re-create mine. So if i want to add other type of tripmine- freeze mine, i need to create another one array, f. e: g_SavedEntityRef_freeze[d]. Right? It would be something like:
PHP Code:
    for (new MaxClientsmaxentsc++ && new MaxClientsmaxentsd++) 
Default code:
PHP Code:
public Action:RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl String:classname[64];
    new 
maxents GetMaxEntities();
    for (new 
MaxClientsmaxentsc++)
    {
        new 
ref g_SavedEntityRef[c];
        if (
ref != && EntRefToEntIndex(ref) == c// it's an entity we created
        
{
            new 
beam_entmine_ent;
            
GetEntityNetClass(cclassnamesizeof(classname));
            if (
StrEqual(classname"CBeam")) // it's a beam
            
{
                
beam_ent c;
                
mine_ent EntRefToEntIndex(g_TripmineOfBeam[c]);
            }
            else 
// it must be a tripmine
            
{
                
mine_ent c;
                
beam_ent GetEntPropEnt(mine_entProp_Send"m_hEffectEntity");
            }

            
RemoveBeamEntity(beam_ent);
            
RemoveMineEntity(mine_ent);
        }
    }

Thanks a lot.

P.S It was hard to explain this part. Please ask me, if you didn't get the question, i'll try to explain it in other way.
MindeLT is offline
Send a message via Skype™ to MindeLT
Reply


Thread Tools
Display Modes

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 04:16.


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