SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/06/2020, 03:30 AM   #21
jasperschellekens
High-roller
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 1,064
Reputation: 106
Default Re: Server is crashing

Yes it is. You are trying to access an invalid vehicle id(my assumption cus the array size is 2k).
You will want to look for timers in your script that handles vehicles and you might want to add this:
For example:
pawn Code:
public UpdateVehicle(vehicleid)
{
    if(vehicleid != INVALID_VEHICLE_ID)
    {
        //your code here
    }
    return 1;
}
__________________
If you want to have your own custom script, or even want to have one of our already released scripts, join our SCRIPTING SERVICES DISCORD, or send me a private message!


Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Discord - Website
jasperschellekens is offline   Reply With Quote
Old 05/06/2020, 02:40 PM   #22
Pitstop
Big Clucker
 
Join Date: Aug 2015
Posts: 94
Reputation: 3
Default Re: Server is crashing

Quote:
Originally Posted by jasperschellekens View Post
Yes it is. You are trying to access an invalid vehicle id(my assumption cus the array size is 2k).
You will want to look for timers in your script that handles vehicles and you might want to add this:
For example:
pawn Code:
public UpdateVehicle(vehicleid)
{
    if(vehicleid != INVALID_VEHICLE_ID)
    {
        //your code here
    }
    return 1;
}
I did and server keep crashing..
Pitstop is offline   Reply With Quote
Old 05/06/2020, 03:25 PM   #23
Cell_
Big Clucker
 
Join Date: May 2012
Posts: 158
Reputation: 48
Default Re: Server is crashing

Quote:
Originally Posted by Pitstop View Post
Hey.

I've noticed that 30 minutes before the server crashed I got some errors in server logs

Code:
[12:27:51] [debug] Run time error 4: "Array index out of bounds"
[12:27:51] [debug]  Attempted to read/write array element at index 65535 in array of size 2000
[12:27:51] [debug] AMX backtrace:
[12:27:51] [debug] #0 003a9aa8 in public Timers () at E:\Script\gamemodes\RP.pwn:75843
Is it maybe related to the server crashes?
Hardly think that is the reason of crash. Index out of bound does not make the server crash. However, you would still need to fix this error. Can you post the line 75843 in your RP.pwn and if possible the whole function the line relates to?
Cell_ is online now   Reply With Quote
Old 05/06/2020, 03:44 PM   #24
Pitstop
Big Clucker
 
Join Date: Aug 2015
Posts: 94
Reputation: 3
Default Re: Server is crashing

Quote:
Originally Posted by Cell_ View Post
Hardly think that is the reason of crash. Index out of bound does not make the server crash. However, you would still need to fix this error. Can you post the line 75843 in your RP.pwn and if possible the whole function the line relates to?
Hey mate ♥.
I already solved the whole errors problems of index out of bound.
Server is still keep crashing......
Pitstop is offline   Reply With Quote
Old 05/06/2020, 04:23 PM   #25
Cell_
Big Clucker
 
Join Date: May 2012
Posts: 158
Reputation: 48
Default Re: Server is crashing

Quote:
Originally Posted by Pitstop View Post
Hey mate ♥.
I already solved the whole errors problems of index out of bound.
Server is still keep crashing......
Does crashdetect detect it? How long does it take for the server to crash after it's started? What is the last thing that happens before the crash?
__________________
Discord: madgenius0#4058
Cell_ is online now   Reply With Quote
Old 05/06/2020, 04:29 PM   #26
Pitstop
Big Clucker
 
Join Date: Aug 2015
Posts: 94
Reputation: 3
Default Re: Server is crashing

Quote:
Originally Posted by Cell_ View Post
Does crashdetect detect it? How long does it take for the server to crash after it's started? What is the last thing that happens before the crash?
Crashdetect isn't giving me a specific line why it happen.
Mhm there's no constant time to shut down... just randomly
Last thing always changed .... sometime just a /stopanim's command sometimes just admin commands.
But I have timer of saving data every minute so it maybe related to that. I am currently trying to convert MySQL from R33 to R40.. maybe problem will be solved?
Pitstop is offline   Reply With Quote
Old 05/06/2020, 04:54 PM   #27
Cell_
Big Clucker
 
Join Date: May 2012
Posts: 158
Reputation: 48
Default Re: Server is crashing

Quote:
Originally Posted by Pitstop View Post
Crashdetect isn't giving me a specific line why it happen.
Mhm there's no constant time to shut down... just randomly
Last thing always changed .... sometime just a /stopanim's command sometimes just admin commands.
But I have timer of saving data every minute so it maybe related to that. I am currently trying to convert MySQL from R33 to R40.. maybe problem will be solved?
I mean if it didn't crash before and it started crashing after the MYSQL changes, then it is probably something with the new MYSQL code. You should go through that, maybe do some debugging to ensure that's the thing that is causing the crash.

Also ensure that in your server.cfg, crashdetect is the first plugin that is loaded, for example:
Code:
plugins crashdetect mysql etc
The reason I asked how long it takes for the server to crash is because you can add trace to your server.cfg to let crashdetect print what gets called so you can see what is the last thing that was called before the crash. If you want to do that, you should add:
Code:
trace pfn
to your server.cfg (at the bottom) maybe. This will spam your server_log, but it will ensure you know what was the last thing to happen and narrow out the possibilities.

Also compile with -d3 parameter to allow crashdetect to get debug information.
__________________
Discord: madgenius0#4058
Cell_ is online now   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
Server Crashing dudu_Insane Scripting Help 8 03/11/2019 01:47 AM
Server Crashing After Upgrading To Windows Server 2016 NinjaChicken Server Support 4 04/07/2018 02:35 PM
Server Crashing - by someone pls help TheLegend1 Scripting Help 10 28/09/2015 11:52 AM
My server crashing. AlterEGO Scripting Help 3 18/10/2014 12:34 PM
Server Crashing every hour, please help[Provided Server Log with crashdetect] Guest4390857394857 Server Support 5 09/06/2014 10:46 AM


All times are GMT. The time now is 09:36 PM.


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