Y_ini creating the file, but not saving stats in it
#1

Hello I'm switching from SII to Y_ini.

However I've got some trouble.
When a player joins the server and their name isn't known yet they see the register dialog.
When a player types in his password his password and IP should be saved in the .ini file. However the file is created for the specific player, but it's empty...

Here's my code:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
   
    //Stuf
    if(!fexist(file) && PInfo[playerid][Logged] == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Enter your password:", "Register", "");
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_REGISTER && response)
    {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Password invalid, Enter your password:", "Register", "");

        SendClientMessage(playerid,COLOR_GREEN,"Registered");
       
        new INI:Player = INI_Open(GetPlayerPath(playerid));
        INI_SetTag(Player, "Data");
        INI_WriteInt(Player,"Password", udb_hash(inputtext));
        INI_WriteInt(Player, "Level", 0);
        INI_Close(Player);
       
        //other stuff, messages etc
    }
So I register to the server, then pause the game and go check the scriptfiles\Players folder and see my name as a .ini file, however when I open it, it's just empty... no tag, no pass, no ip...

Any help?
Reply
#2

Did some further testing, and it loads properly.
However still doesn't save...
Reply
#3

Password must be written as String not Int.
Reply
#4

udb_hash returns an integer so it's fine. Though, I don't know what the problem is.
Reply
#5

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Password must be written as String not Int.
No, udb_hash returns an integer, so his codes are right, I suggest you try using whirpool instead.
Reply
#6

Run the server.exe as an Admin. I had the same problem. It's a permissions problem from what I see.
Reply
#7

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
Run the server.exe as an Admin. I had the same problem. It's a permissions problem from what I see.
Yes it worked, but the problem is that to run it as an administrator I need a password (because I use the family pc instead of my own because my own is to old to run SAMP) which I don't know...
Reply
#8

Try to move your samp server's folder to like desktop and see if it still needs the permission.

Since some folders in your C drive can be protected
Reply
#9

nope :/
Anyways, thanks for the help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)