09.10.2016, 12:33
Hi guys I created a register system but apparently it doesn't write anything on the .INI File..
Please help
Please help
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,""S_GREEN"Registering..",""S_RED"Invalid length.\n"S_LIGHTBLUE"Type your password below to register an account","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Pass",udb_hash(inputtext));
INI_WriteInt(File,"Money",50000);
INI_WriteInt(File,"AdminLevel",0);
INI_WriteInt(File,"Donor",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Score",0);
ShowPlayerDialog(playerid,DIALOG_SUCCESS_1,DIALOG_STYLE_MSGBOX,""S_BLUE"Registered!",""S_GREEN"You have now registered here!Hope you enjoy the stay!","Ok","");
}
}
case DIALOG_LOGIN:
{
if( !response ) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == pInfo[playerid][Pass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid,pInfo[playerid][Money]);
ShowPlayerDialog(playerid,DIALOG_SUCCESS_2,DIALOG_STYLE_MSGBOX,""S_GREEN"Success!",""S_BLUE"You have successfully logged in!Welcome back!","Ok.","");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,""S_WHITE"Login",""S_RED"You have entered an invalid password!.\n"S_WHITE"Type your password below to login!","Login","Quit");
}
return 1;
}
}
}
return 1;
}