Raised This Month: $ Target: $400
 0% 

Entity gets removed or replaced by another


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-28-2009 , 08:00   Entity gets removed or replaced by another
Reply With Quote #1

Ok so here goes, i'm making this fireworks plugin and i'm creating env_shooter alot in it. Now it works prefectly, it does the things i want it to do but it has 1 side effect. When it is shooting and i let it spawn alot of times, it removes weapons or grenades that are beeing trown. Most of the times it is when the round restarts and then env_shooter is beeing created alot of times and then sometimes weapons get removed from players.

Now does anyone know how to fix this?
I linked the env_shooter code.

Thanks in advance!

PHP Code:
stock env_shooter(client ,Float:Angles[3], Float:iGibsFloat:DelayFloat:GibAngles[3], Float:VelocityFloat:VarianceFloat:GiblifeFloat:Location[3] )
{
    
decl Ent;

    
//Initialize:
    
Ent CreateEntityByName("env_shooter");
        
    
//Spawn:

    
if (Ent == -1)
    return;

      if (
Ent>0)
      {

    
//Properties:
    //DispatchKeyValue(Ent, "targetname", "flare");

    // Gib Direction (Pitch Yaw Roll) - The direction the gibs will fly. 
    
DispatchKeyValueVector(Ent"angles"Angles);

    
// Number of Gibs - Total number of gibs to shoot each time it's activated
    
DispatchKeyValueFloat(Ent"m_iGibs"iGibs);

    
// Delay between shots - Delay (in seconds) between shooting each gib. If 0, all gibs shoot at once.
    
DispatchKeyValueFloat(Ent"delay"Delay);

    
// <angles> Gib Angles (Pitch Yaw Roll) - The orientation of the spawned gibs. 
    
DispatchKeyValueVector(Ent"gibangles"GibAngles);

    
// Gib Velocity - Speed of the fired gibs. 
    
DispatchKeyValueFloat(Ent"m_flVelocity"Velocity);

    
// Course Variance - How much variance in the direction gibs are fired. 
    
DispatchKeyValueFloat(Ent"m_flVariance"Variance);

    
// Gib Life - Time in seconds for gibs to live +/- 5%. 
    
DispatchKeyValueFloat(Ent"m_flGibLife"Giblife);
        
    
// <choices> Used to set a non-standard rendering mode on this entity. See also 'FX Amount' and 'FX Color'. 
    
DispatchKeyValue(Ent"rendermode""5");

    
// Model - Thing to shoot out. Can be a .mdl (model) or a .vmt (material/sprite). 
    
new rand GetRandomInt(0,4);
    switch(
rand)
    {
        case 
0:    DispatchKeyValue(Ent"shootmodel""materials/sprites/blueflare1.vmt");
        case 
1:    DispatchKeyValue(Ent"shootmodel""materials/effects/redflare.vmt");
        case 
2DispatchKeyValue(Ent"shootmodel""materials/sprites/yellowflare.vmt");
        case 
3DispatchKeyValue(Ent"shootmodel""materials/sprites/orangeflare1.vmt");
        case 
4DispatchKeyValue(Ent"shootmodel""materials/sprites/flare1.vmt");
    }

    
// <choices> Material Sound
    
DispatchKeyValue(Ent"shootsounds""-1"); // No sound

    // <choices> Simulate, no idea what it realy does tbh...
    // could find out but to lazy and not worth it...
    //DispatchKeyValue(Ent, "simulation", "1");

    
SetVariantString("spawnflags 4");
    
AcceptEntityInput(Ent,"AddOutput");

    
//Input:
    // Shoot!
    
AcceptEntityInput(Ent"Shoot"client);
            
    
//Send:
    
TeleportEntity(EntLocationNULL_VECTORNULL_VECTOR);

    
//Delete:
    
CreateTimer(2.5KillEntEnt);
    }
}

public 
Action:KillEnt(Handle:Timerany:Ent)
{
    
//Kill:
    
if(IsValidEdict(Ent)) AcceptEntityInput(Ent"Kill");

__________________
V0gelz is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-28-2009 , 19:11   Re: Entity gets removed or replaced by another
Reply With Quote #2

OK fixed it. nvm xD
__________________
V0gelz 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 20:47.


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