Raised This Month: $51 Target: $400
 12% 

Save Map - Restore map after server crashed or restarted


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
brian201049
Member
Join Date: Mar 2011
Location: Hong Kong
Old 12-29-2011 , 16:33   Save Map - Restore map after server crashed or restarted
Reply With Quote #1

Save Map
Version: 1.0 (30/12/2011 Updated)

This plugin can save the map name when the map loaded and it can change to the saved map after the server crashed or restart.

It is useful with Serverdoc or HL Server Monitor for Windows server.

This plugin used FValut system. http://forums.alliedmods.net/showthread.php?t=76453

Cvar:
defaultmap <map name> - Default map if the map record isn't exist or unreadable (Default: de_dust)

Credits:
Exolent[jNr] - His FVault system

How to compile:
1. Download fvault.inc and place it in scripting/include folder
2. Download savemap.sma (Click Get Source) and place it in scripting folder
3. Drag savemap.sma into compiler.exe
4. Go to scripting/compiled find savemap.amxx

You MUST place server.bsp into maps folder and change your startup parameter to +map server (YOU DON'T NEED TO UPLOAD THIS MAP ON YOUR FASTDL SERVER)

The web compiler cannot compile this plugin. Please download the source and compile it locally.
Attached Files
File Type: inc fvault.inc (14.3 KB, 314 views)
File Type: zip savemap.zip (2.6 KB, 329 views)
File Type: sma Get Plugin or Get Source (savemap.sma - 1277 views - 724 Bytes)

Last edited by brian201049; 12-30-2011 at 00:52.
brian201049 is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-29-2011 , 16:35   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #2

Cool
__________________

Last edited by kramesa; 12-29-2011 at 16:39.
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-29-2011 , 17:18   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #3

there is a much simpler way to do this without fvault (or any vault) and without a new bsp.

Also, the client_connect() function is not needed. Just remove it.
__________________

Last edited by fysiks; 12-29-2011 at 17:22.
fysiks is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 12-29-2011 , 19:24   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #4

Interesting! Simple, but good.
__________________



pacheco is offline
brian201049
Member
Join Date: Mar 2011
Location: Hong Kong
Old 12-30-2011 , 00:53   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #5

I just deleted the client_connect() function and the g_NoPlayers global variable.
Thank you. Could u tell me your saving method without vault?

Last edited by brian201049; 12-30-2011 at 00:54.
brian201049 is offline
m0skVi4a
Senior Member
Join Date: May 2011
Location: Rousse, Bulgaria
Old 12-30-2011 , 03:39   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #6

Nice
m0skVi4a is offline
Send a message via Skype™ to m0skVi4a
OxfordL
Member
Join Date: Nov 2011
Location: Paris
Old 12-30-2011 , 03:51   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #7

Good
OxfordL is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2011 , 04:29   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #8

I'm pretty sure this plugin has been made before. This is probably how I would do it:

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    new 
szFilepath[128]
    
get_configsdir(szFilepathcharsmax(szFilepath))
    
add(szFilepathcharsmax(szFilepath), "/lastmap.ini")
    
    new 
szStoredInfo[3]
    
get_localinfo("asdf"szStoredInfocharsmax(szStoredInfo))
    
set_localinfo("asdf""2")
    
    if( 
str_to_num(szStoredInfo) == )
    {
        new 
szMapName[32]; get_mapname(szMapNamecharsmax(szMapName));
        new 
fopen(szFilepath"w")
        if(
f)
        {
            
fputs(fszMapName)
            
fclose(f)
        }
    }
    else
    {
        new 
fopen(szFilepath"r")
        if(
f)
        {
            new 
data[32]
            
fgets(fdatacharsmax(data))
            
trim(data)
            
server_cmd("changelevel %s"data)
            
fclose(f)
        }
    }

__________________
fysiks is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 12-30-2011 , 05:18   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #9

Mapcycle State Restorer
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
jackas
Senior Member
Join Date: Feb 2011
Old 01-01-2012 , 07:33   Re: Save Map - Restore map after server crashed or restarted
Reply With Quote #10

Excellent
__________________
For our new family member's in alliedmods
Quote:
Originally Posted by bo0m View Post
Ok, there are a couple ways to find this, here are about 5:
1. Search
2. Search again
3. If you don't find it, then search again.
4. After searching the 3rd time, search again
5. Then when you are tired of searching, just search some more!!!!
jackas is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 15:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode