Код:
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, "Registering...","{FF0000}You have entered an invalid password.\n""Type your password below to register a new account.","Register","Quit");
dini_Create(UserPath(playerid));
dini_Set(UserPath(playerid),"Password",inputtext);
dini_IntSet(UserPath(playerid),"Cash",0);
dini_IntSet(UserPath(playerid),"Admin",0);
dini_IntSet(UserPath(playerid),"Kills",0);
dini_IntSet(UserPath(playerid),"Deaths",0);
dini_IntSet(UserPath(playerid),"WantedLevel",0);
dini_IntSet(UserPath(playerid),"Vip",0);
dini_IntSet(UserPath(playerid),"Score",0);
dini_IntSet(UserPath(playerid),"Condoms",0);
dini_IntSet(UserPath(playerid),"Banned",0);
dini_IntSet(UserPath(playerid),"Jailed",0);
dini_IntSet(UserPath(playerid),"Drugs",0);
dini_IntSet(UserPath(playerid),"Nopm",0);
dini_IntSet(UserPath(playerid),"Bank",0);
dini_IntSet(UserPath(playerid),"Sausages",0);
dini_IntSet(UserPath(playerid),"PassChange",0);
dini_IntSet(UserPath(playerid),"Mute",0);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"{008000}Success!","{FF0000}Registered and autologged! Now all your data are saved. (Money,score,robberies,wanted level etc)","Ok","");
}
}
case DIALOG_LOGIN:
{
if (!response) return Kick(playerid);
if( response )
{
if(!strcmp(inputtext, dini_Get(UserPath(playerid), "Password")))
{
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"{008000}Success!","{FFFF00}You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","{FF0000}You have entered an incorrect password.\n""Type your password below to login.","Login","Quit");
}
return 1;
}
}
}