30.10.2013, 10:34
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:
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?
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
}
Any help?


