AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Export Nvault data to .txt file. (https://forums.alliedmods.net/showthread.php?t=163885)

yokomo 08-04-2011 14:27

[SOLVED] Export Nvault data to .txt file.
 
Hi, did anyone know how export data from nvault into .txt file? I've search but found nothing about this.

Hunter-Digital 08-04-2011 15:04

Re: [HELP] Export Nvault data to .txt file.
 
Well, search for tutorials on how to read from nvault and search for tutorials on how to write files, then combine the knowledge and voilla !
Try it and if you can't get it to work, post your code and we'll help.

NOTE: This is scripting help section, not requests :P

yokomo 08-05-2011 00:24

Re: [HELP] Export Nvault data to .txt file.
 
Wrong section eh? ok please locked it.

Bugsy 08-05-2011 12:39

Re: [HELP] Export Nvault data to .txt file.
 
http://forums.alliedmods.net/showthread.php?t=139584
http://www.amxmodx.org/funcwiki.php?go=func&id=88

Bugsy 08-05-2011 19:45

Re: [HELP] Export Nvault data to .txt file.
 
The export file will be created in the vault directory. You must specify nVaultFile and OutputFile. The default delimiter char is tab but you can change to whatever.
PHP Code:

#include <amxmodx>
#include <nvault_util>

new const Version[] = "0.1";

new const 
nVaultFile[] = "vault_name";
new const 
Delimiter '    ';
new const 
OutputFile[] = "nvault_export.txt";

new 
szFile64 ];

public 
plugin_init() 
{
    
register_plugin"Export nVault to Text" Version "bugsy" );
    
    
formatexszFileget_datadirszFile charsmaxszFile ) ) ] , charsmaxszFile ) , "/vault/%s" OutputFile );
    
    new 
iVaultHandle nvault_util_opennVaultFile );
    
nvault_util_readalliVaultHandle "nvault_export_fwd" );
    
nvault_util_closeiVaultHandle );
}

public 
nvault_export_fwdiCurrent iTotal , const szKey[] , const szVal[] , iTimeStamp , const Data[] , iSize )
{
    static 
szData1024 ];

    
formatexszData charsmaxszData ) , "%s%c%s%c%d" szKey Delimiter szVal Delimiter iTimeStamp ); 
    
write_fileszFile szData );



yokomo 08-06-2011 02:07

Re: [HELP] Export Nvault data to .txt file.
 
Quote:

Originally Posted by Bugsy (Post 1526592)
The export file will be created in the vault directory. You must specify nVaultFile and OutputFile. The default delimiter char is tab but you can change to whatever.
PHP Code:

#include <amxmodx>
#include <nvault_util>

new const Version[] = "0.1";

new const 
nVaultFile[] = "vault_name";
new const 
Delimiter '    ';
new const 
OutputFile[] = "nvault_export.txt";

new 
szFile64 ];

public 
plugin_init() 
{
    
register_plugin"Export nVault to Text" Version "bugsy" );
    
    
formatexszFileget_datadirszFile charsmaxszFile ) ) ] , charsmaxszFile ) , "/vault/%s" OutputFile );
    
    new 
iVaultHandle nvault_util_opennVaultFile );
    
nvault_util_readalliVaultHandle "nvault_export_fwd" );
    
nvault_util_closeiVaultHandle );
}

public 
nvault_export_fwdiCurrent iTotal , const szKey[] , const szVal[] , iTimeStamp , const Data[] , iSize )
{
    static 
szData1024 ];

    
formatexszData charsmaxszData ) , "%s%c%s%c%d" szKey Delimiter szVal Delimiter iTimeStamp ); 
    
write_fileszFile szData );



Thank you bugsy, work fine just like i want :)

rx1983 12-25-2012 16:10

Re: [SOLVED] Export Nvault data to .txt file.
 
how to create a new file. nvault_export.txt
overwriting what was written before?
ie always deleting what was already her ???

Torge 12-25-2012 18:09

Re: [SOLVED] Export Nvault data to .txt file.
 
Did you ever watched at the date?

rx1983 12-25-2012 20:32

Re: [SOLVED] Export Nvault data to .txt file.
 
Quote:

Originally Posted by Torge (Post 1860386)
Did you ever watched at the date?

i not undertand :S

Torge 12-26-2012 11:45

Re: [SOLVED] Export Nvault data to .txt file.
 
This topic is very old and I think there's no one to help you.


All times are GMT -4. The time now is 03:20.

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