SA-MP Forums Archive
Create File - 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: Create File (/showthread.php?tid=261813)



Create File - Wesley221 - 15.06.2011

Hey guys,

Im working on a bank FS, and i just got a new problem with making a new userfile.
When i register the bank account (on a command), enter a password, it creates a file. But there's one problem with the file, its just called "65ni". I dont know what i did wrong, and aslong as i know im doing it the right way. Getting no errors when compiling, and the code is down here.

pawn Код:
#define Bankfile "AdvancedBank/Users/%.ini" // The bank file define
new file[100], name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name)); // Gets the player name
format(file, sizeof(file), Bankfile, name); // Formats the bank file, so the file can be created
dini_Create(file); // Creates the file "65ni"
dini_Set(file, "Bank owner", name);
dini_IntSet(file, "Password", num_hash(inputtext));
dini_IntSet(file, "Registered", 1);
dini_IntSet(file, "Cash amount", 0);
dini_IntSet(file, "Logged", 1);
format(string, sizeof(string), " ** You succesfully registered your bank account. Account name: %s, Password: %s", name, inputtext);
SendClientMessage(playerid, SKY_BLUE, string);
~Wesley


Re: Create File - Sascha - 15.06.2011

pawn Код:
AdvancedBank/Users/%.ini
should be
pawn Код:
AdvancedBank/Users/%s.ini



Re: Create File - Wesley221 - 15.06.2011

Ah duh, missed that one
Thanks!