Raised This Month: $ Target: $400
 0% 

NVault reands data once on the map? ;o


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 06-29-2012 , 21:15   NVault reands data once on the map? ;o
Reply With Quote #1

Hello! I'm using nvault_util http://forums.alliedmods.net/showthread.php?t=139584 and I have problem.

The file saves some ID nvault where the key is Nick writes such a random ID.

Code:
public Save(id)
{
	new vaultkey[128],vaultdata[256], nick[35];
	get_user_name(id, nick, 34);
	
	format(vaultdata, charsmax(vaultdata),"#%i", GID[id]); // GID[id] = Random ID;
	
	format(vaultkey, charsmax(vaultkey),"%s-GID", name);
	nvault_set(vaultGID,vaultkey,vaultdata);
	
	return PLUGIN_CONTINUE;
}
And I'm using NVault_Util to retrieve datas where GID[data] == GID[id]:

Code:
public GetData(id)
{
	new iPos , szKey[ 32 ] , szVal[ 64 ] , iTimeStamp, GID2;
	new iVaultHandle = nvault_util_open("GID2")
	new iCount = nvault_util_count(iVaultHandle);
	new name[35];
	
	for ( new iCurrent = 1 ; iCurrent <= iCount ; iCurrent++ )
	{
		iPos = nvault_util_read( iVaultHandle , iPos , szKey , charsmax( szKey ) , szVal , charsmax( szVal ) , iTimeStamp );
		
		replace_all(szVal, 63, "#", " ");
		
		new date[32];
		parse(szVal, date, 31);
		
		GID2 = str_to_num(dane);
		
		if(GID[id] == GID2)
		{
			format(name, 34, "%s",szKey);
			name[strlen(name)-4] = 0;
			client_print(id, print_chat, "%s", name);
		}
	}
	nvault_util_close(iVaultHandle);
}
But when someone writes a GID in NVault during the game, he no longer appears in GetData(id), until a map change can I fix it somehow?

It seems that once NVault reads data at startup and then does not. I tried to load the data again in the game, but it did not help.
Screeaam.. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-29-2012 , 21:22   Re: NVault reands data once on the map? ;o
Reply With Quote #2

No way to "fix" this, data is saved in the journal only until nvault_close or map-change/server shut-down.
__________________

Last edited by Bugsy; 06-29-2012 at 21:22.
Bugsy is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 06-29-2012 , 22:04   Re: NVault reands data once on the map? ;o
Reply With Quote #3

Ok.. Is there another way to read and write that data excluding MySQL?
Screeaam.. is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-29-2012 , 22:09   Re: NVault reands data once on the map? ;o
Reply With Quote #4

SQLite is another way. It is similar to MySQL but the database is store locally instead of remote
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 06-29-2012 , 22:14   Re: NVault reands data once on the map? ;o
Reply With Quote #5

What about FVault?

SQLite for me it's black magic. If given a choice between MySQL and SQLite is a MySQL would have taken, because more I understand him. But not so good to using it.
Screeaam.. is offline
Reply


Thread Tools
Display Modes

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