AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Huge lag spike on new round (https://forums.alliedmods.net/showthread.php?t=318837)

Celena Luna 09-23-2019 12:38

Huge lag spike on new round
 
1 Attachment(s)
I don't know why but I got a huge lag on round start.
When I remove the CustomForward, there ain't any lag at all. Did I do something wrong?

On LAN Server, the ping went from 0 to 1-2 but in HLDS, it went from ~30 to 120+ for few seconds.

PHP Code:

public fw_Player_Spawn(id)
{
    if(!
g_AllowInfection)
        
CurePlayer(id0)
}

public 
CurePlayer(victimattacker)
{
    
ExecuteForward(g_Forwards[FW_USER_CURE_PRE], g_ForwardResultvictimattacker)
    if(
g_ForwardResult >= PLUGIN_HANDLED)
        return

    if(!
is_user_alive(victim))
        return    

    
UnSet_BitVar(g_IsZombievictim)

    
ExecuteForward(g_Forwards[FW_USER_CURE_POST], g_ForwardResultvictimattacker)


Edit: Even when the CustomForward hasn't been used in any plugin, the lag still occurred
Edit2: File attached.

LearninG 09-23-2019 13:08

Re: Huge lag spike on new round
 
show the entire plugin

Celena Luna 09-23-2019 13:44

Re: Huge lag spike on new round
 
Quote:

Originally Posted by LearninG (Post 2667951)
show the entire plugin

I upload the file.

DJEarthQuake 09-29-2019 15:39

Re: Huge lag spike on new round
 
Possibly...

Code:
public fw_Player_Spawn(id) {         if(!g_AllowInfection) {         CurePlayer(id, 0)         }         if(Get_BitVar(g_IsZombie, id) && g_AllowRespawn) {         InfectPlayer(id, 0)         } }


All times are GMT -4. The time now is 17:18.

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