Sign in to follow this  
piKA

HELP script restart all

Recommended Posts

my mta server bugged and i need to restart all the scripts !

i can do that with P admin panel?

because i cant restart the server

Share this post


Link to post
Posted (edited)
7 hours ago, piKA said:

my mta server bugged and i need to restart all the scripts !

i can do that with P admin panel?

because i cant restart the server

use these functions :

getResources () -- this function returns a table, so you need a loop for get the resources

getResourceName() -- use this function in the loop for get the name of the resource
-- or use directly:
restartResource(value) -- use this function in the loop when you want to restart the resource , value = value of the loop

 

Edited by NX_CI

Share this post


Link to post

server side 

addCommandHandler ( "rsall" , function ( ) 
for k,v in ipairs ( getResources ( ) ) do 
if ( getResourceState ( v ) == "Running" ) then 
restartResource ( v )
end
end
end ) ; 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.