[DUDB] Change files folder - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [DUDB] Change files folder (
/showthread.php?tid=148010)
[DUDB] Change files folder -
Gzsume - 15.05.2010
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.
Re: [DUDB] Change files folder -
Zh3r0 - 15.05.2010
Problem might be...
pawn Код:
#define DUDB_FILE_PATH "\Users\%s.dudb.sav"
with the double \\?
Re: [DUDB] Change files folder -
Gzsume - 15.05.2010
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.
Re: [DUDB] Change files folder -
Zh3r0 - 15.05.2010
May we see some of the code?
Re: [DUDB] Change files folder -
Gzsume - 15.05.2010
Sure.
Click for see in full screen.
Re: [DUDB] Change files folder -
GTAguillaume - 15.05.2010
You need to use '/'.
@Torran: Oh that too,
use:
Код:
format(tmp, sizeof tmp,DUDB_FILE_PATH,usersname);
udb_create(tmp,"Test");
Re: [DUDB] Change files folder -
Torran - 15.05.2010
Because your not telling it to save in the DUDB_FILE_PATH
Re: [DUDB] Change files folder -
Gzsume - 15.05.2010
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. :/
Re: [DUDB] Change files folder -
Gzsume - 17.05.2010
UP, please.