[DUDB] Change files folder
#1

Hello,
First, I want to say than I'm sorry for mistakes I could make in english, that's not my native language.
I want to change the files path with DUDB. I've seen than I should do that :


Код:
#define DUDB_FILE_PATH "\\Users\\%s.dudb.sav"
#include <dudb>
And create myself the folder "Users". I did it, but when I create a file (for an account for example), the file is created in the folder "scriptfiles", not in "scriptfiles/Users".

Can someone help me ?
For information, I'm on Windows Vista.
Thanks,
Gzsume.
Reply
#2

Problem might be...

pawn Код:
#define DUDB_FILE_PATH "\Users\%s.dudb.sav"
with the double \\?
Reply
#3

Quote:
Originally Posted by PlayON
Problem might be...

pawn Код:
#define DUDB_FILE_PATH "\Users\%s.dudb.sav"
with the double \\?
No, I've try "\\", "\", and "/". I can't try "//", else it'll believe it's a comment.
Reply
#4

May we see some of the code?
Reply
#5

Sure.
Click for see in full screen.


Reply
#6

You need to use '/'.
@Torran: Oh that too,
use:
Код:
format(tmp, sizeof tmp,DUDB_FILE_PATH,usersname);
udb_create(tmp,"Test");
Reply
#7

Because your not telling it to save in the DUDB_FILE_PATH
Reply
#8

So I did what you said, this is my code :

Код:
#include <a_samp>
#include <Dini>
#include <dutils>
#include <dudb>

#pragma unused ret_memcpy

#define DUDB_FILE_PATH "\\Users\\%s.dudb.sav"


GetPlayerFile(playerid)
{
	new playername[MAX_PLAYER_NAME],
	  playerfile[256];
	GetPlayerName(playerid,playername,sizeof(playername));
	format(playerfile,sizeof(playerfile),DUDB_FILE_PATH,playername);
	return playerfile;
}

public OnPlayerConnect(playerid)
{
	new playerip[16],
		tmp[256];
	GetPlayerIp(playerid,playerip,sizeof(playerip));
	udb_Create(GetPlayerFile(playerid),"Test");
	udb_UserSet(GetPlayerFile(playerid),"LastIP",playerip);
	
	format(tmp,sizeof(tmp),"Your last IP is: %s",udb_User(GetPlayerFile(playerid),"LastIP"));
	SendClientMessage(playerid,0xFFFFFFFF,tmp);
	return 1;
}
But the file still don't be create in "scriptfiles/Users", it's create in "scriptfiles" and his name isn't "Gzsume", but "_04Users_04_05NSG_06Gzsume_08dudb_08sav.dudb.sav" .

Anyone has a solution ?
Thanks,
Gzsume.

Edit: With "/" (and not "\\"), the file has that name : "_03Users_03_05NSG_06Gzsume_08dudb_08sav.dudb.sav" . So, that don't solve my problem. :/
Reply
#9

UP, please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)