02.01.2012, 19:32
Try this:
What I changed is, the form of !response and added SavePlayer(playerid); to save the DATA - Then kick.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_LOG:
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_CheckLogin(PlayerName(playerid),inputtext))
{
LoadPlayer(playerid);
Logged[playerid]=true;
SendClientMessage(playerid,COLOR_GREEN,"( ! ) Access granted ! You're now logged in !");
return 1;
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_INPUT,"Welcome to Spring Wood RPG","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
}
}
}
case DIALOG_REG:
{
if(!response)
{
SavePlayer(playerid);
Kick(playerid);
}
if(response)
{
if(udb_Create(PlayerName(playerid),inputtext))
{
RemoveJob(playerid);
SetJob(playerid,1);
ResetPlayerECash(playerid);
GivePlayerECash(playerid, 25);
SavePlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_INPUT,"Welcome to Spring Wood RPG","You have successfully registered !\nType your password below to login.","Login","Quit");
return 1;
}}}}
return 1;
}