[Include] AutoRestarter
#1

.::AutoRestarter V2::.
1)Download the file AutoRestarterV2.inc(4shared) , then place it on your includes folder wich is on pawno directory (pawno/include/)
2)At the top of your gamemode, include the include
pawn Code:
#include <AutoRestarterV2>
3)Place AutoRestarterV2 function where you want to trigger the restart timer.
4)Compile your gamemode and restart it.

.::AutoRestarterV2 Function::.
pawn Code:
ServerRestart(days,hours,minutes,seconds,message);
Code:
days = The days you want the server to restart.
hours = The hours you want the server to restart.
minutes = The minutes you want the server to restart.
seconds = The seconds you want the server to restart.
message = 0 or 1 or 2 or 3

0 = Nothing displaying
1 = Send only Server Console info message
2 = Send only Client info message
3 = Send both console and client message
.::Examples::.

Restart server every 5 days with displaying messages.
pawn Code:
public OnGameModeInit
{
ServerRestart(5,0,0,0,3);
}
When ServerRestart will triggered on console will be displayed this message:
Code:
Server will restart on 5 day(s).
Also when ServerRestart will triggered on client will be displayed this message:
Code:
Server will restart on 5 day(s).
Restart server when a deathmatch ends(The callback is just an example) with client message
pawn Code:
public DMend
{
GivePlayerMoney(playerid,1000);
SetPlayerHealth(playerid,100);
ServerRestart(0,0,0,45,2)
}
When ServerRestart will triggered on client will be displayed this message:
Code:
Server will restart on 45 second(s).
Enjoy..
Reply
#2

Very Nice and Simple.
Reply
#3

Yeah, It's nice and simple!
Reply
#4

Nice Work Mate Keep It up
Reply
#5

gmx it's not full restart. And give many lags.
Reply
#6

Quote:
Originally Posted by Geryy
View Post
gmx it's not full restart. And give many lags.
How would you otherwise restart it?
Reply
#7

So simple, it's brilliant. :O
Reply
#8

im running my gm on 0.3b and tryed adding this to my script but came up with errors so my question is is this compatible with 3b?
Reply
#9

I didn't actually test this, as I just did it the simple way, with timers and stocks. However, since this was created after the 0.3G release, you would think that its compatible... What errors did you receive?
Reply
#10

Код:
#include <AutoRestarterV2>

new ServerRestart(days,hours,minutes,seconds,message);

OnGameModeInit
{
  ServerRestart(5,0,0,0,3);
}

if ServerRestart(days,hours,minutes,seconds,message){

  days = The days you want the server to restart.
  hours = The hours you want the server to restart.
  minutes = The minutes you want the server to restart.
  seconds = The seconds you want the server to restart.
  message = 0 or 1 or 2 or 3

  0 = Nothing displaying
  1 = Send only Server Console info message
  2 = Send only Client info message
  3 = Send both console and client message
  return 1;
}
do i do it like this as i suspect i did it wrong
*EDIT this is not how i did it
Reply
#11

Great, I needed this, good job!
Reply
#12

Quote:
Originally Posted by Lookin
Посмотреть сообщение
Код:
#include <AutoRestarterV2>

new ServerRestart(days,hours,minutes,seconds,message);

OnGameModeInit
{
  ServerRestart(5,0,0,0,3);
}

if ServerRestart(days,hours,minutes,seconds,message){

  days = The days you want the server to restart.
  hours = The hours you want the server to restart.
  minutes = The minutes you want the server to restart.
  seconds = The seconds you want the server to restart.
  message = 0 or 1 or 2 or 3

  0 = Nothing displaying
  1 = Send only Server Console info message
  2 = Send only Client info message
  3 = Send both console and client message
  return 1;
}
do i do it like this as i suspect i did it wrong
*EDIT this is not how i did it
nahh
remove this code:
pawn Код:
new ServerRestart(days,hours,minutes,seconds,message);

if ServerRestart(days,hours,minutes,seconds,message){

  days = The days you want the server to restart.
  hours = The hours you want the server to restart.
  minutes = The minutes you want the server to restart.
  seconds = The seconds you want the server to restart.
  message = 0 or 1 or 2 or 3

  0 = Nothing displaying
  1 = Send only Server Console info message
  2 = Send only Client info message
  3 = Send both console and client message
  return 1;
}
This code it was just an example to figure out the variables of the function

so keep only this code:
pawn Код:
#include <AutoRestarterV2>

OnGameModeInit
{
  ServerRestart(5,0,0,0,3);
}
It should work fine .
Best Regards
Reply
#13

28/09/2010 - 11:30
-Major bug fixed!
-File updated!
Reply
#14

thanks am testing it now
Reply
#15

Quote:
Originally Posted by Mujib
View Post
How would you otherwise restart it?
Close sa-mp.exe then re-open it? oh w8, thts 2 hard.
Reply
#16

Quote:
Originally Posted by DiddyBop
View Post
Close sa-mp.exe then re-open it? oh w8, thts 2 hard.
lmfao rofl
Reply
#17

Done Verry Thanks im like it
_________________________

Reply
#18

Quote:
Originally Posted by Mujib
Посмотреть сообщение
How would you otherwise restart it?
Kill the process and then reopen the server console. This way it will do a clean restart and no one will get "Server Closed Connection." GMX is crap and screws things up.
Reply
#19

Wow! Very, very nice!
Reply
#20

i tested it out for awhile and it works great but be careful as it conflicts with a few things im not sure why

Код:
1. This forum requires that you wait 120 seconds between posts. Please try again in 41 seconds.
ok this is getting annoying lol
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)