02.01.2012, 19:48
yep, that should work.
In case it shouldnt, delay the kick with a timer so the entered data is saved first before the kick.
And please, indend ur code better next time, trust me, it is more important then u think it is.
At the beginning i also didnt give a f*** about it but some weeks ago i had to go throught 100k script lines and fix all the code indendation to make a "growing" script readable.
Do it from the beginning on and prevent a lot of work later
In case it shouldnt, delay the kick with a timer so the entered data is saved first before the kick.
And please, indend ur code better next time, trust me, it is more important then u think it is.
At the beginning i also didnt give a f*** about it but some weeks ago i had to go throught 100k script lines and fix all the code indendation to make a "growing" script readable.
Do it from the beginning on and prevent a lot of work later

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 !");
}
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;
}

