02.01.2012, 19:01
hi, I use dudb date base, I made login and register system, and wor great but if somebody registered log in server and if he/she push on cancel he/she get kick ( how I wanted ) but all his/her stuff get delete, what to do?
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) return 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;
}