Sign in to follow this  

Server shutdown event

Recommended Posts

Hey guys

first of all i'm not sure if this is the right area so pls dont be mean ;)

I am about to make an Roleplay script and got a little problem. I have to say that i am a bit new to nodejs i am new in ragemp and just got experience with C# (GTMP) and Pawn(Samp).

When i create my Vehicle handling (load save and stuff) i does it in that way 

- Loading all Vehicles from Database on Server start

- Save a vehicle on special tasks like create, take dmg, player exit

- save all Vehicles on server stop (to avoid any save troubles)


i didnt find any serverStop event in ragemp wiki. normaly it didnt need to save any vehicle on server stop because i save it everytime a player leave the Vehicle. BUT i want to add smth like an Mechanicle team and the PD should have a option to tow a wrong parked vehicle when it is looked 


can you say me an way to call functions on serverstop 



an other way is to create a timer every 10 sek. and check if the vehicle moved and when save it. but i think if there are maybe 50 players and everyone driving they are 50 querys every 10 second sounds like performance troubles

Edited by notorious_nils
some stupid grammar stuff

Share this post

Link to post
Share on other sites

I'm using process NodeJs.


process.on('exit', function(code) {
    console.log(`About to exit with code: ${code}`);
	//some code


Edited by Sgoldik
  • Like 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   1 member