Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* -------------Easy Server Restart by Slo_Runner------------------------------
- Code by: slorunner
- @ Gmail : [email protected]
- @ Skype : pekarna.cerkno
- ---------------------------Donations-------------------------------------------
- Bitcoin: 1LoaMPdxnUECaXusPTMLPJ9pJCxbcKHU27
- Dogecoin: DCPbvRmU4TeNApvVbCHN9QAn1HDz8ghjik
- Syscoin: SPhevhnp2MegNvQBM7ZcUz4fw4uBhaictB
- Blackcoin: B9iHDPU16vv3BQW5vnh45Kjnyjzoj28ZCx
- -------------------------------------------------------------------------------
- Don't remove credits!!!
- -------------------------------------------------------------------------------
- */
- #define RESTART_TIME 5 // set restart delay in minutes
- #define FILTERSCRIPT
- #define PASS "your long pass or something xD" //change to total random pass :D
- #include <a_samp>
- #if defined FILTERSCRIPT
- new Text:restart_text;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Easy Server Restart by Slo_Runner");
- print("--------------------------------------\n");
- SendRconCommand("exec server");
- return 1;
- }
- #endif
- forward gmx_timer();
- forward destroy_draw();
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/gmx", cmdtext, true) == 0)
- {
- new string[128];
- if (IsPlayerAdmin(playerid)) {
- new Float: rtime = RESTART_TIME;
- restart_text = TextDrawCreate(200.0, 200.0, "SERVER RESTART");
- TextDrawShowForAll(restart_text);
- SetTimer("destroy_draw", 10000, false);
- new hostname[64];
- GetServerVarAsString("hostname", hostname, sizeof(hostname));
- format(string,sizeof(string),"hostname %s [RESTARTING]", hostname);
- SendRconCommand(string);
- format(string,sizeof(string),"[RESTART] Server is gonna restart in %.0f minutes!!", rtime);
- SendClientMessageToAll(0x55000000, string);
- format(string,sizeof(string),"password %s", PASS);
- SendRconCommand(string);
- SetTimer("gmx_timer", 1000*60*RESTART_TIME, false);
- return 1;
- }
- }
- return 0;
- }
- public destroy_draw(){
- TextDrawDestroy(restart_text);
- }
- public gmx_timer(){
- SendRconCommand("gmx");
- }
Advertisement
Add Comment
Please, Sign In to add comment