AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Server Crashing from this piece of code (https://forums.alliedmods.net/showthread.php?t=324526)

Shadows Adi 05-18-2020 16:14

Server Crashing from this piece of code
 
Hi,
I recently made this piece of code:
PHP Code:

get_time"%H"iTimecharsmax(iTime) );
    
cTime str_to_numiTime );
    if( 
cTime >= get_pcvar_numvip_free_start ) || cTime <= get_pcvar_numvip_free_end ) )
    {
        
set_pcvar_numpCvars VipFree ], );
    }
    else
    {
        
set_pcvar_numpCvars VipFree ], );
    } 

When this code is in the plugin, the server is crashing with no message in console.
I removed this and the server works.
Anyone any idea?

JocAnis 05-18-2020 16:52

Re: Server Crashing from this piece of code
 
when/how often is that code called, maybe that matters?

fysiks 05-18-2020 23:03

Re: Server Crashing from this piece of code
 
Try and narrow it down further and validate that the cvar pointers are valid.

Shadows Adi 05-19-2020 06:04

Re: Server Crashing from this piece of code
 
Quote:

Originally Posted by JocAnis (Post 2700915)
when/how often is that code called, maybe that matters?

Code called in plugin_init().
These are the defined variables:
PHP Code:

static cTime;
static 
iTime[3]; 


fysiks 05-19-2020 21:18

Re: Server Crashing from this piece of code
 
Where do you get your cvar pointers? Did you make sure that they are valid immediately before the crash? Also, try creating a small plugin with just this code (and any directly related parts) to try to reproduce the crash.


All times are GMT -4. The time now is 16:57.

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