small bug
#2

Try this:

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;
}
What I changed is, the form of !response and added SavePlayer(playerid); to save the DATA - Then kick.
Reply


Messages In This Thread
small bug - by mineralo - 02.01.2012, 19:01
Re: small bug - by Thunderbolt - 02.01.2012, 19:32
Re: small bug - by BlackWolf120 - 02.01.2012, 19:48

Forum Jump:


Users browsing this thread: 2 Guest(s)