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

SuperSpawns cause extreme lag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-06-2016 , 09:27   SuperSpawns cause extreme lag
Reply With Quote #1

This code is causing huge lag on almost every spawn...
Any ideas how to fix it?
My ping goes to 150-200 even when I am alone in the server...

PHP Code:
#include <amxmodx>
#include <superspawns>
#include <hamsandwich>

new const g_iRespawnTime 3;

public 
plugin_init()
{
    
GetSpawnPoints();
    
    new 
iEnt create_entity("info_target");
    
entity_set_string(iEntEV_SZ_classname"thinker");
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 5.0); 
    
    
register_think("thinker""Respawn");
    
    
RegisterHam(Ham_Spawn"player""fwdPlayerSpawnPost"1);
}

GetSpawnPoints()
{
    
SsInit(3500.0);
    
SsScan();
}

public 
fwdPlayerSpawnPost(id)
{
    if(
is_user_alive(id))
    {
        static 
Float:origin[3];
        for(;;)
        {
            if(
SsGetOrigin(origin))
            {
                
entity_set_vector(idEV_VEC_originorigin);
                break;
            }
            
GetSpawnPoints();
        }
    }
}

public 
Respawn(ent)
{
    static 
iiCountiPlayers[32];
    
get_players(iPlayersiCount"be""CT");
    for(
i=0i<iCounti++)
        
ExecuteHamB(Ham_CS_RoundRespawniPlayers[i]);
    
entity_set_float(entEV_FL_nextthinkget_gametime() + g_iRespawnTime);


Edit: It's happening only on small maps like fy_snow. De_dust2 has absolutelly no problem!
How do I fix it for small maps

Last edited by didoWEE; 04-06-2016 at 13:12. Reason: fixed 1st problem now I have another one
didoWEE is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 04-06-2016 , 20:17   Re: SuperSpawns cause extreme lag
Reply With Quote #2

Why are you using register_think to respawn players?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-07-2016 , 00:48   Re: SuperSpawns cause extreme lag
Reply With Quote #3

use deathmsg instead of think.
siriusmd99 is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-07-2016 , 08:34   Re: SuperSpawns cause extreme lag
Reply With Quote #4

You don't say anything usefull
I've fixed it already
My thinker has nothing to do with lag!
Problem is in SuperSpawns but you didn't notice it
didoWEE is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-07-2016 , 11:16   Re: SuperSpawns cause extreme lag
Reply With Quote #5

Quote:
Originally Posted by didoWEE View Post
You don't say anything usefull
I've fixed it already
My thinker has nothing to do with lag!
Problem is in SuperSpawns but you didn't notice it
Oh , you think i give a freak? Do you pay to get "usefull" help?
This is open forum for all who wants help or to help someone.
I didn't know that that include had a problem, you didn't even posted it. How could I know that.
With that behaviour i don't think you'll get help in future, i dont speak about all members but me specially.
siriusmd99 is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 04-08-2016 , 04:46   Re: SuperSpawns cause extreme lag
Reply With Quote #6

Is there any particular reason to use SuperSpawns?
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-09-2016 , 13:32   Re: SuperSpawns cause extreme lag
Reply With Quote #7

Quote:
Originally Posted by siriusmd99 View Post
Do you pay to get "usefull" help?
wtf?

Quote:
Originally Posted by siriusmd99 View Post
I didn't know that that include had a problem, you didn't even posted it. How could I know that.
Topic Title: SuperSpawns cause extreme lag
Looks like I really didn't post it, right?

Quote:
Originally Posted by NiHiLaNTh View Post
Is there any particular reason to use SuperSpawns?
I want completely random spawns for every single map... I just don't know any other way
didoWEE 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 18:14.


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