Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <mysql>
- #include <zcmd>
- #define MAX_TABLES 50
- #include <MyDump>
- new MyDump:export; //Variable für das MyDump-Handle erstellen.
- public OnFilterScriptInit()
- {
- export = MyDumpExportInit("localhost", "root", "*****", "test"); //MyDump initialisieren.
- SetAutoExportTime(3600, export); //Auto-Export-Timer auf 1h stellen.
- SetAutoExportIfNotExists(0, export); //IfNotExists-Option von Auto-Export
- //deaktivieren.
- AutoExportTimerStart(export); //Auto-Export-Timer starten.
- return 1;
- }
- public OnFilterScriptExit()
- {
- AutoExportTimerStop(export); //Auto-Export-Timer stoppen.
- MyDumpExportExit(export); //MyDump deinitialisieren.
- return 1;
- }
- COMMAND:backup(playerid,params[]) //Ein Command via ZCMD erstellen.
- {
- if(!IsPlayerAdmin(playerid)) return 1; //Falls Spieler kein Admin ist: Abbrechen.
- ExportTablesToFile("export.sql", export, 1); //Datenbank zu "export.sql" exportieren
- //mit "IF NOT EXISTS"-Zusatz bei
- //"CRATE TABLE".
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement