AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   WHAT inside plugins may cause choke loss on clients (https://forums.alliedmods.net/showthread.php?t=87372)

Speed! 03-10-2009 18:02

WHAT inside plugins may cause choke loss on clients
 
when i amx_off , everything turns right with my 32 slots custom zombie plague server, if not, 50 loss (sometimes) etc... i NEVER get ping
btw i suspect this is laging my clients

PHP Code:

public make_shield(const Float:vOrigin[3])
{
    new 
i_Ent engfunc(EngFunc_CreateNamedEntity,g_EntMine);
    
set_pev(i_Ent,pev_classname,"shield");



    
set_pev(i_Ent,pev_frame,0);
    
set_pev(i_Ent,pev_body,3);
//    new Float:mins[3] = { -100.0, -100.0, -100.0 }, Float:maxs[3] = { 100.0, 100.0, 100.0 };
//    fm_entity_set_size(i_Ent,mins,maxs)
//    set_pev(i_Ent, pev_origin, vOrigin );
//    fm_entity_set_origin(i_Ent, vOrigin)
    
engfuncEngFunc_SetSizei_Ent,  {-30.0, -30.0, -40.0},  {30.030.040.0})
    
engfunc(EngFunc_SetModel,i_Ent,model_aura_shield);
    
engfuncEngFunc_SetOrigini_Ent vOrigin );

    
fm_set_rendering(i_Ent,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,140)
    
set_task(10.3"remove_shield"i_Ent)
    
set_pev(i_Ent,pev_solid,SOLID_BBOX);


btw, im using this together with a 0.1 settask
PHP Code:

public PushPlayer(const Float:center[3]) 
{     
    static 
client 
    
for (client 1client <= g_maxplayersclient++) 
    { 
        new 
Float:origin[3]; 
        
pev(clientpev_originorigin); 
         
        new 
Float:dist get_distance_f(origincenter); 
        if( 
dist PUSH_RADIUS ) continue; 
        if( !
g_zombie[client] || g_nodamage[client]  )
        {
            if (
dist PUSH_RADIUS 20)
            {
                
g_inaura[client] = true
                fm_set_user_godmode
(client1)
                
set_task(0.4"remove_inaura"client)
            }
        }
         
        if( !
g_zombie[client] || g_nodamage[client] || g_nemesis[client] ) continue;
         
        new 
Float:speed = (1.0 - (dist PUSH_RADIUS)) * PUSH_SPEED
         
        new 
Float:velocity[3]; 
        
velocity[0] = origin[0] - center[0]; 
        
velocity[1] = origin[1] - center[1]; 
        
velocity[2] = origin[2] - center[2]; 
             
        new 
Float:length vector_length(velocity); 
         
        
velocity[0] = velocity[0] / length speed
        
velocity[1] = velocity[1] / length speed
        
velocity[2] = velocity[2] / length speed
             
        new 
Float:current[3]; 
        
pev(clientpev_velocitycurrent); 
         
        
current[0] += velocity[0]; 
        
current[1] += velocity[1]; 
        
current[2] += velocity[2]; 
         
        
set_pev(clientpev_velocitycurrent); 
    } 



Dr.G 03-10-2009 18:19

Re: many entities cause loss/choke on clients?
 
loss and choke is from my point of view a rate problem. if ppls rates is way higher then the server rates you will see those problems. but it can also come from too many entitys. Try and set a max number of those shields like 25 or so and see if it gets better....

Arkshine 03-10-2009 18:29

Re: many entities cause loss/choke on clients?
 
Your first code is fine.

Quote:

btw, im using this together with a 0.1 settask
You should not use set_task for that. Try to create an entity which think each 0.1 seconds. Also don't create var into a loop. Use static. The performance will be better.


All times are GMT -4. The time now is 09:03.

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