Doesn't create userfile - 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)
+--- Thread: Doesn't create userfile (
/showthread.php?tid=442185)
Doesn't create userfile -
Facerafter - 06.06.2013
In my user system.
After a player registers it doesn't create a file of the user.
Register:
pawn Код:
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","{FFFFFF}You have entered an {ADFF2F} invalid password.\n{FFFFFF}Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Sex",0);
INI_WriteInt(File,"Age",0);
INI_WriteFloat(File,"Pos_x",0);
INI_WriteFloat(File,"Pos_y",0);
INI_WriteFloat(File,"Pos_z",0);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Cookie",0);
INI_WriteInt(File,"Accent",0);
INI_WriteInt(File,"Member",0);
INI_WriteInt(File,"Leader",0);
INI_WriteInt(File,"Division",0);
INI_WriteInt(File,"DivLeader",0);
INI_WriteInt(File,"Rank", 0);
INI_WriteInt(File,"Banned", 0);
INI_Close(File);
What did i forget... ?
Re: Doesn't create userfile -
Kalladel - 06.06.2013
Check the userpath in the top of the script - Its probably - Users or u non-capital.. Check the userpath first.
Re: Doesn't create userfile -
Facerafter - 06.06.2013
pawn Код:
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
...
Re: Doesn't create userfile -
Kalladel - 06.06.2013
Make it
pawn Код:
#define PATH "Users/%s.ini"
and make a "Users" folder inside your scriptfiles...
Re: Doesn't create userfile -
Facerafter - 06.06.2013
Thanks it worked!.