SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 15/07/2019, 05:10 PM   #1
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 809
Reputation: 320
Default SDiag - automatic diagnostics of frequent problems when the server starts

SDiag

This include is intended to diagnose frequently encountered problems, many of which often appear through negligence. The script checks some conditions and then displays the corresponding warnings in the console and the server log.

Important note: this script only detects problems, but does not fix them on its own!

Currently it can detect the following problems:
  • Missing FILTERSCRIPT define in filterscripts (it's needed for many includes to work correctly)
  • Mismatch of MAX_PLAYERS macro and actual player slots on the server
  • GetTickCount overflow due to long continuous physical server operation
  • Outdated version of default SA-MP includes in relation to version of the server executable file (checks for 0.3.7, 0.3.7-R2, 0.3.7-R3 and 0.3.DL)
  • Absence of the scriptfiles folder or lack of access to it (it's needed for some scripts to work correctly)

Installation
Nothing complicated. Just download the script from one of the links below, move it to pawno/include folder and add to all filterscripts and gamemode by this way:
PHP Code:
#include <sdiag> 
and then recompile them.


How to use
When you turn the server on, a number of warnings will appear in the console if any problems are detected. Warnings in the gamemode are marked as "[SDiag: GM]" and "[SDiag: FS]" in filterscripts. Include doesn't have information about the name of the filterscript in which it detects a problem, but it's easy to understand in which filterscript it's occurred as after the warning you will see a message about the successful loading of that filterscript (before which the problem occurred).


Download
v1.0: Solidfiles MediaFire Pastebin


Warnings description
Below is an explanation and description of all the warnings that this script displays:

HTML Code:
One of your filterscripts doesn't have FILTERSCRIPT define
This warning occurs when one of your filterscripts doesn't have the "#define FILTERSCRIPT" code at the very beginning. Just add it and don't neglect it henceforth, because many includes change their behavior depending on whether they are included to a filterscript or gamemode.

HTML Code:
Your MAX_PLAYERS define isn't equal to the real number of player slots
This means that the value of the MAX_PLAYERS macro in one of your scripts doesn't match with the value of real player slots set in server.cfg. Discrepancy of these values can lead to "array index out of bounds" runtime errors with arrays that use MAX_PLAYERS as one of their dimensions.

HTML Code:
GetTickCount is less than 0. Please restart your computer
Occurs when your physical server (computer) runs continuously for several weeks, causing GetTickCount to overflow (takes negative values). In this case you just need to restart the computer (if turning off and then turning on doesn't help, then you need to exactly restart it).

HTML Code:
The SA-MP includes version doesn't match with the server version. Please update them
It means that the default SA-MP includes outdated in relation to the version of the server that is currently running. Just update your includes by downloading samp-server archive from the official site with the necessary version of the server and includes.

HTML Code:
Your scriptfiles folder isn't created or you don't have access to it (some scripts may not work correctly)
This occurs when you don't have the "scriptfiles" folder, which should be located in the folder with the server. It may also occur if you don't have access to it. In this case (in case of its absence) create it or (if it has already been created) contact the hosting technical support/configure access rights yourself. Some scripts save their data here and they cannot create this folder on their own.


You can also suggest your ideas to add to this script. Perhaps there are still some frequent problems that you are already tired of encountering finding them manually each time? So share it.
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker

Last edited by OstGot; 16/07/2019 at 12:15 PM.
OstGot is offline   Reply With Quote
Old 16/07/2019, 11:04 AM   #2
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 809
Reputation: 320
Default Re: SDiag - automatic diagnostics of frequent problems when the server starts

Added a more detailed description of the occurring warnings
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 16/07/2019, 11:51 AM   #3
NikitaFoxze
Little Clucker
 
NikitaFoxze's Avatar
 
Join Date: Mar 2018
Posts: 17
Reputation: 0
Thumbs up Re: SDiag - automatic diagnostics of frequent problems when the server starts

For newcomers the most times thank you!
NikitaFoxze is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequent crashes in just one server. Possible fix? MafiaOink Client Support 2 03/08/2018 09:18 AM
Gamemode starts "hanging", ackslimit problems? faxxe Scripting Help 2 24/02/2017 04:10 PM
Server causes frequent client crashes (mostly 0x6BD) denNorske Scripting Help 2 17/12/2016 09:55 PM
Automatic Gate Code Problems AK47317 Help Archive 7 06/11/2010 11:14 AM
When 0.3 starts, i had problems with my script. [FBI]Gstar Help Archive 2 18/11/2009 08:58 PM


All times are GMT. The time now is 02:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.